Commit e9417f0
committed
npu:phytium: fix build error in phytium_npu_pci_probe
Log:
2025-05-16T15:13:43.6129337Z drivers/staging/phytium-npu/phytium_npu_pci.c:82:16: error: variable 'reg_addr' is used uninitialized whenever 'for' loop exits because its condition is false [-Werror,-Wsometimes-uninitialized]
2025-05-16T15:13:43.6131548Z 82 | for (bar = 0; bar < NUM_PCI_BARS; bar++) {
2025-05-16T15:13:43.6132195Z | ^~~~~~~~~~~~~~~~~~
2025-05-16T15:13:43.6133127Z drivers/staging/phytium-npu/phytium_npu_pci.c:98:7: note: uninitialized use occurs here
2025-05-16T15:13:43.6134010Z 98 | if (!reg_addr)
2025-05-16T15:13:43.6134457Z | ^~~~~~~~
2025-05-16T15:13:43.6135385Z drivers/staging/phytium-npu/phytium_npu_pci.c:82:16: note: remove the condition if it is always true
2025-05-16T15:13:43.6136692Z 82 | for (bar = 0; bar < NUM_PCI_BARS; bar++) {
2025-05-16T15:13:43.6137381Z | ^~~~~~~~~~~~~~~~~~
2025-05-16T15:13:43.6138490Z drivers/staging/phytium-npu/phytium_npu_pci.c:52:24: note: initialize the variable 'reg_addr' to silence this warning
2025-05-16T15:13:43.6139510Z 52 | void __iomem *reg_addr;
2025-05-16T15:13:43.6140038Z | ^
2025-05-16T15:13:43.6140541Z | = NULL
2025-05-16T15:13:43.6141173Z 1 error generated.
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent b01ddcb commit e9417f0
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments