Variable val is "u32" always >= 0, so val >= 0 condition are redundant.
Clean up the following coccicheck warning:
./drivers/net/dsa/qca8k.c:732:5-8: WARNING: Unsigned expression compared
with zero: val >= 0.
Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
drivers/net/dsa/qca8k.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
From: Vladimir Oltean <olteanv@gmail.com> Date: 2021-05-19 18:24:09
Hi Jiapeng,
On Wed, May 19, 2021 at 06:49:51PM +0800, Jiapeng Chong wrote:
quoted hunk
Variable val is "u32" always >= 0, so val >= 0 condition are redundant.
Clean up the following coccicheck warning:
./drivers/net/dsa/qca8k.c:732:5-8: WARNING: Unsigned expression compared
with zero: val >= 0.
Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
drivers/net/dsa/qca8k.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
The qca8k driver has some problems with the handling of signed/unsigned
return values. I would suggest a better approach to be to make
qca8k_mii_read32 to return an int value, and keep this check as is.