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 <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz 2024-04-27 08:53:15 +02:00 committed by Mateusz Szafoni
parent 52473d7fa2
commit 87b940a611

View File

@ -319,6 +319,10 @@ static int pci_qemu_test_probe(FAR struct pci_device_s *dev)
{ {
ops = &g_pci_qemu_test_io_ops; ops = &g_pci_qemu_test_io_ops;
} }
else
{
PANIC();
}
for (test_cnt = 0; test_cnt < 0xff; test_cnt++) for (test_cnt = 0; test_cnt < 0xff; test_cnt++)
{ {