qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/3] pci: pci_add_option_rom(): improve style


From: David Hildenbrand
Subject: Re: [PATCH v2 1/3] pci: pci_add_option_rom(): improve style
Date: Tue, 2 May 2023 11:37:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 25.04.23 18:14, Vladimir Sementsov-Ogievskiy wrote:
Fix over-80 lines and missing curly brackets for if-operators, which
are required by QEMU coding style.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
  hw/pci/pci.c | 20 +++++++++++---------
  1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index def5000e7b..4a61c8d24a 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2297,10 +2297,12 @@ static void pci_add_option_rom(PCIDevice *pdev, bool 
is_default_rom,
      char name[32];
      const VMStateDescription *vmsd;
- if (!pdev->romfile)
+    if (!pdev->romfile) {
          return;
-    if (strlen(pdev->romfile) == 0)
+    }
+    if (strlen(pdev->romfile) == 0) {
          return;
+    }

Could be further simplified to

if (!pdev->romfile || !strlen(pdev->romfile)) {
        return;
}


Reviewed-by: David Hildenbrand <david@redhat.com>

--
Thanks,

David / dhildenb




reply via email to

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