Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eth: phytmac: phytmac_plat_probe: initialize variable 'ret' when !pda…
…ta->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 <[email protected]>
- Loading branch information