diff mbox series

[08/12] pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration

Message ID 20220628131032.213986-9-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series s390-ccw bios fixes and clean-ups | expand

Commit Message

Thomas Huth June 28, 2022, 1:10 p.m. UTC
It looks nicer if we separate the run_ccw() from the IPL_assert()
statement, and the error message should talk about "virtio device"
instead of "block device", since this code is nowadays used for
non-block (i.e. network) devices, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 pc-bios/s390-ccw/virtio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Cornelia Huck June 28, 2022, 1:26 p.m. UTC | #1
On Tue, Jun 28 2022, Thomas Huth <thuth@redhat.com> wrote:

> It looks nicer if we separate the run_ccw() from the IPL_assert()
> statement, and the error message should talk about "virtio device"
> instead of "block device", since this code is nowadays used for
> non-block (i.e. network) devices, too.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  pc-bios/s390-ccw/virtio.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Eric Farman July 1, 2022, 6:38 p.m. UTC | #2
On Tue, 2022-06-28 at 15:10 +0200, Thomas Huth wrote:
> It looks nicer if we separate the run_ccw() from the IPL_assert()
> statement, and the error message should talk about "virtio device"
> instead of "block device", since this code is nowadays used for
> non-block (i.e. network) devices, too.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Eric Farman <farman@linux.ibm.com>

> ---
>  pc-bios/s390-ccw/virtio.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
> index d8c2b52710..f37510f312 100644
> --- a/pc-bios/s390-ccw/virtio.c
> +++ b/pc-bios/s390-ccw/virtio.c
> @@ -289,9 +289,8 @@ void virtio_setup_ccw(VDev *vdev)
>              .num = 0,
>          };
>  
> -        IPL_assert(
> -            run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config,
> sizeof(config), false) == 0,
> -            "Could not get block device VQ configuration");
> +        rc = run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config,
> sizeof(config), false);
> +        IPL_assert(rc == 0, "Could not get virtio device VQ
> configuration");
>          info.num = config.num;
>          vring_init(&vdev->vrings[i], &info);
>          vdev->vrings[i].schid = vdev->schid;
diff mbox series

Patch

diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index d8c2b52710..f37510f312 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -289,9 +289,8 @@  void virtio_setup_ccw(VDev *vdev)
             .num = 0,
         };
 
-        IPL_assert(
-            run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false) == 0,
-            "Could not get block device VQ configuration");
+        rc = run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false);
+        IPL_assert(rc == 0, "Could not get virtio device VQ configuration");
         info.num = config.num;
         vring_init(&vdev->vrings[i], &info);
         vdev->vrings[i].schid = vdev->schid;