[PATCH 1/7] pc-bios/s390-ccw: Fix Misattributed Function Prototypes

jrossi@linux.ibm.com posted 7 patches 3 weeks, 4 days ago
Maintainers: Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Jared Rossi <jrossi@linux.ibm.com>, Zhuoying Cai <zycai@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, John Snow <jsnow@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 1/7] pc-bios/s390-ccw: Fix Misattributed Function Prototypes
Posted by jrossi@linux.ibm.com 3 weeks, 4 days ago
From: Jared Rossi <jrossi@linux.ibm.com>

The virtio-blkdev functions are incorrectly listed in s390-ccw.h as belonging to
virtio.c.  Additionally, virtio_load_direct() has an unused subchan_id argument.

Remove the unused argument and move the prototypes to virtio.h so that they are
independent from the CCW bus.

Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
---
 pc-bios/s390-ccw/s390-ccw.h      | 4 ----
 pc-bios/s390-ccw/virtio.h        | 7 +++++++
 pc-bios/s390-ccw/bootmap.c       | 2 +-
 pc-bios/s390-ccw/virtio-blkdev.c | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index b1dc35cded..47ea66bd4d 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -67,11 +67,7 @@ void sclp_get_loadparm_ascii(char *loadparm);
 int sclp_read(char *str, size_t count);
 
 /* virtio.c */
-unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long rec_list2,
-                                 unsigned long subchan_id, void *load_addr);
 bool virtio_is_supported(SubChannelId schid);
-int virtio_blk_setup_device(SubChannelId schid);
-int virtio_read(unsigned long sector, void *load_addr);
 
 /* bootmap.c */
 void zipl_load(void);
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
index 5c5e808a50..597bd42358 100644
--- a/pc-bios/s390-ccw/virtio.h
+++ b/pc-bios/s390-ccw/virtio.h
@@ -277,7 +277,14 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd);
 int virtio_reset(VDev *vdev);
 int virtio_setup_ccw(VDev *vdev);
 
+/* virtio-net.c */
 int virtio_net_init(void *mac_addr);
 void virtio_net_deinit(void);
 
+/* virtio-blkdev.c */
+int virtio_blk_setup_device(SubChannelId schid);
+int virtio_read(unsigned long sector, void *load_addr);
+unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long rec_list2,
+                                 void *load_addr);
+
 #endif /* VIRTIO_H */
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 0f8baa0198..420ee32eff 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -662,7 +662,7 @@ static int zipl_load_segment(ComponentEntry *entry)
                  */
                 break;
             }
-            address = virtio_load_direct(cur_desc[0], cur_desc[1], 0,
+            address = virtio_load_direct(cur_desc[0], cur_desc[1],
                                          (void *)address);
             if (!address) {
                 puts("zIPL load segment failed");
diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c
index 7b2d1e20f4..4b819dd80f 100644
--- a/pc-bios/s390-ccw/virtio-blkdev.c
+++ b/pc-bios/s390-ccw/virtio-blkdev.c
@@ -64,7 +64,7 @@ int virtio_read_many(unsigned long sector, void *load_addr, int sec_num)
 }
 
 unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long rec_list2,
-                                 unsigned long subchan_id, void *load_addr)
+                                 void *load_addr)
 {
     u8 status;
     int sec = rec_list1;
-- 
2.49.0
Re: [PATCH 1/7] pc-bios/s390-ccw: Fix Misattributed Function Prototypes
Posted by Thomas Huth 3 weeks, 4 days ago
On 20/10/2025 18.20, jrossi@linux.ibm.com wrote:
> From: Jared Rossi <jrossi@linux.ibm.com>
> 
> The virtio-blkdev functions are incorrectly listed in s390-ccw.h as belonging to
> virtio.c.  Additionally, virtio_load_direct() has an unused subchan_id argument.
> 
> Remove the unused argument and move the prototypes to virtio.h so that they are
> independent from the CCW bus.
> 
> Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
> ---

I'd maybe spell "Misattributed Function Prototypes" with small letters in 
the title, but apart from that, patch looks good to me:

Reviewed-by: Thomas Huth <thuth@redhat.com>
Re: [PATCH 1/7] pc-bios/s390-ccw: Fix Misattributed Function Prototypes
Posted by Jared Rossi 3 weeks, 3 days ago

On 10/20/25 12:50 PM, Thomas Huth wrote:
> On 20/10/2025 18.20, jrossi@linux.ibm.com wrote:
>> From: Jared Rossi <jrossi@linux.ibm.com>
>>
>> The virtio-blkdev functions are incorrectly listed in s390-ccw.h as 
>> belonging to
>> virtio.c.  Additionally, virtio_load_direct() has an unused 
>> subchan_id argument.
>>
>> Remove the unused argument and move the prototypes to virtio.h so 
>> that they are
>> independent from the CCW bus.
>>
>> Signed-off-by: Jared Rossi <jrossi@linux.ibm.com>
>> ---
>
> I'd maybe spell "Misattributed Function Prototypes" with small letters 
> in the title, but apart from that, patch looks good to me:
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
Thanks Thomas,

I'm not sure why I wrote it like that.  I notice now I did the same 
thing with "Architecture" in patch 3.  I'll fix the capitalization in 
both patches for the next version.

Regards,
Jared Rossi