This is an automated email from the ASF dual-hosted git repository.

raiden00 pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 87b940a61178c23d0c2ffce600a20bbe7847a123
Author: p-szafonimateusz <[email protected]>
AuthorDate: Sat Apr 27 08:53:15 2024 +0200

    drivers/pci_qemu_test.c: fix compiler warning
    
    pci/pci_qemu_test.c:218:6: warning: ‘ops’ may be used uninitialized 
[-Wmaybe-uninitialized]
      218 |   ops->write(dev->bus, &hdr->test, num, sizeof(num));
          |   ~~~^~~~~~~
    pci/pci_qemu_test.c: In function ‘pci_qemu_test_probe’:
    pci/pci_qemu_test.c:286:41: note: ‘ops’ was declared here
      286 |   FAR const struct pci_qemu_test_ops_s *ops;
          |
    
    Signed-off-by: p-szafonimateusz <[email protected]>
---
 drivers/pci/pci_qemu_test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/pci_qemu_test.c b/drivers/pci/pci_qemu_test.c
index e2ce0972a3..c2f07103a7 100644
--- a/drivers/pci/pci_qemu_test.c
+++ b/drivers/pci/pci_qemu_test.c
@@ -319,6 +319,10 @@ static int pci_qemu_test_probe(FAR struct pci_device_s 
*dev)
         {
           ops = &g_pci_qemu_test_io_ops;
         }
+      else
+        {
+          PANIC();
+        }
 
       for (test_cnt = 0; test_cnt < 0xff; test_cnt++)
         {

Reply via email to