Commit c69ebe8
committed
phytium: phytmac: fix build with clang
Log:
drivers/net/ethernet/phytium/phytmac_platform.c:232:8: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
232 | if (!pdata->msg_regs) {
| ^~~~~~~~~~~~~~~~
drivers/net/ethernet/phytium/phytmac_platform.c:311:9: note: uninitialized use occurs here
311 | return ret;
| ^~~
drivers/net/ethernet/phytium/phytmac_platform.c:232:4: note: remove the 'if' if its condition is always false
232 | if (!pdata->msg_regs) {
| ^~~~~~~~~~~~~~~~~~~~~~~
233 | dev_err(&pdev->dev, "msg_regs ioremap failed, i=%d\n", i);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
234 | goto err_mem;
| ~~~~~~~~~~~~~
235 | }
| ~
drivers/net/ethernet/phytium/phytmac_platform.c:172:9: note: initialize the variable 'ret' to silence this warning
172 | int ret, i;
| ^
| = 0
1 error generated.
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 5f79f87 commit c69ebe8
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
0 commit comments