[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] xen-block: Use one Error * variable instead of two

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 3/3] xen-block: Use one Error * variable instead of two
Date: Tue, 17 Mar 2020 15:32:36 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

13.03.2020 20:05, Markus Armbruster wrote:
Signed-off-by: Markus Armbruster <address@hidden>
  hw/block/xen-block.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 3885464513..7b3b6dee97 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -998,14 +998,13 @@ static void xen_block_device_destroy(XenBackendInstance 
      XenBlockVdev *vdev = &blockdev->props.vdev;
      XenBlockDrive *drive = blockdev->drive;
      XenBlockIOThread *iothread = blockdev->iothread;
+    Error *local_err = NULL;
trace_xen_block_device_destroy(vdev->number); object_unparent(OBJECT(xendev)); if (iothread) {
-        Error *local_err = NULL;
          xen_block_iothread_destroy(iothread, &local_err);
          if (local_err) {
              error_propagate_prepend(errp, local_err,
@@ -1015,8 +1014,6 @@ static void xen_block_device_destroy(XenBackendInstance 
if (drive) {
-        Error *local_err = NULL;
          xen_block_drive_destroy(drive, &local_err);
          if (local_err) {
              error_propagate_prepend(errp, local_err,

Hmm, no "return;" statement after this propagation. It's OK, as there no more code in the 
function after this "if", but I'd add it to be consistent and to avoid forgetting to add 
a return here when add more code to the function.

(and if you do this, you may also fix indentation of string paramter of 

Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]