diff mbox series

net: phy: Fix unsigned comparison with less than zero

Message ID 1635325191-101815-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series net: phy: Fix unsigned comparison with less than zero | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Jiapeng Chong Oct. 27, 2021, 8:59 a.m. UTC
Fix the following coccicheck warning:

./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression
compared with zero: value < 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/phy/at803x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Russell King (Oracle) Oct. 27, 2021, 9:06 a.m. UTC | #1
On Wed, Oct 27, 2021 at 04:59:51PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warning:
> 
> ./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression
> compared with zero: value < 0.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
Jakub Kicinski Oct. 28, 2021, 1:29 a.m. UTC | #2
On Wed, 27 Oct 2021 16:59:51 +0800 Jiapeng Chong wrote:
> Fix the following coccicheck warning:
> 
> ./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression
> compared with zero: value < 0.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")

Please pay more attention.

This is not a correct fixes tag, take a look at the code, the
comparison was introduced in 7beecaf7d507 ("net: phy: at803x: improve
the WOL feature").

Do not fix spelling of the quoted commits. You replaced seperate
with separate and I had fun time trying to figure out why scripts
complain that the fixes tag is incorrect.

Fixed and applied to net-next.
diff mbox series

Patch

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index f1cbe1f..dae95d9 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -484,7 +484,7 @@  static int at803x_set_wol(struct phy_device *phydev,
 static void at803x_get_wol(struct phy_device *phydev,
 			   struct ethtool_wolinfo *wol)
 {
-	u32 value;
+	int value;
 
 	wol->supported = WAKE_MAGIC;
 	wol->wolopts = 0;