diff options
author | Vratko Polak <vrpolak@cisco.com> | 2023-08-23 18:39:25 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2023-09-13 12:17:53 +0000 |
commit | fee945940ce524b235dfcf4e131e8c8520d45a3d (patch) | |
tree | d68cfd9088f0d8a7ba1ca2b339fe2d6b3f6e499b | |
parent | 4585bb121b4acfab2f34237f1d0e9ea6077110c0 (diff) |
vlib: deuglify the offset finding loop in pci.c
Type: style
Fixes: 054229ebbdeb3f87d96c1abf93b511c86cd6ff0f
Change-Id: I7c3080db94566af249e5082d59a4e6373c616888
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
-rw-r--r-- | src/vlib/pci/pci.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/vlib/pci/pci.c b/src/vlib/pci/pci.c index 1845a6211f5..cd580f04176 100644 --- a/src/vlib/pci/pci.c +++ b/src/vlib/pci/pci.c @@ -176,11 +176,7 @@ vlib_pci_function_level_reset (vlib_main_t *vm, vlib_pci_dev_handle_t h) return err; offset = cfg.cap_ptr; - /* Make gcc happy, otherwise gcc fails build due to cap not set if offset == - * 0 */ - cap = (pci_capability_pcie_t *) (cfg.data + offset); - - while (offset) + do { cap = (pci_capability_pcie_t *) (cfg.data + offset); @@ -189,6 +185,7 @@ vlib_pci_function_level_reset (vlib_main_t *vm, vlib_pci_dev_handle_t h) offset = cap->next_offset; } + while (offset); if (cap->capability_id != PCI_CAP_ID_PCIE) return clib_error_return (0, "PCIe capability config not found"); |