Commit 34271e9
WangYuli
eth: phytmac: phytmac_plat_probe: initialize variable 'ret' when !pdata->msg_regs
Fix follow error with clang-19:
drivers/net/ethernet/phytium/phytmac_platform.c:130:8: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
130 | if (!pdata->msg_regs) {
| ^~~~~~~~~~~~~~~~
drivers/net/ethernet/phytium/phytmac_platform.c:202:9: note: uninitialized use occurs here
202 | return ret;
| ^~~
drivers/net/ethernet/phytium/phytmac_platform.c:130:4: note: remove the 'if' if its condition is always false
130 | if (!pdata->msg_regs) {
| ^~~~~~~~~~~~~~~~~~~~~~~
131 | dev_err(&pdev->dev, "msg_regs ioremap failed, i=%d\n", i);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132 | goto err_mem;
| ~~~~~~~~~~~~~
133 | }
| ~
drivers/net/ethernet/phytium/phytmac_platform.c:81:9: note: initialize the variable 'ret' to silence this warning
81 | int ret, i;
| ^
| = 0
1 error generated.
Signed-off-by: WangYuli <wangyuli@uniontech.com>1 parent 8ccf129 commit 34271e9
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
0 commit comments