Skip to content

Commit 860bd3a

Browse files
szafonimateusz-mixiaoxiang781216
authored andcommitted
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]>
1 parent 41d0eaa commit 860bd3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pci/pci_qemu_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ static int pci_qemu_test_probe(FAR struct pci_device_s *dev)
319319
{
320320
ops = &g_pci_qemu_test_io_ops;
321321
}
322+
else
323+
{
324+
PANIC();
325+
}
322326

323327
for (test_cnt = 0; test_cnt < 0xff; test_cnt++)
324328
{

0 commit comments

Comments
 (0)