Skip to contentSkip to conversation

bnx2x: align define usage to satisfy static checkers

PATCH Applied Ariel Elior 2 participants 2 messages Jan 9, 2013 – Jan 10, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: align define usage to satisfy static checkers

Static checkers complained that the E1H_FUNC_MAX define is used incorrectly in bnx2x_pretend_func(). The complaint was justified, although its not a real bug, as the first part of the conditional protects us in this case (a real bug would happen if a VF tried to use the pretend func, but there are no VFs in E1H chips).

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 -1
index 5fcaee1..8740b52 100644
@@ -13361,7 +13361,7 @@ int bnx2x_pretend_func(struct bnx2x *bp, u16 pretend_func_val)
 {
 	u32 pretend_reg;
 
-	if (CHIP_IS_E1H(bp) && pretend_func_val > E1H_FUNC_MAX)
+	if (CHIP_IS_E1H(bp) && pretend_func_val >= E1H_FUNC_MAX)
 		return -1;
 
 	/* get my own pretend register */
Signature · 1 line
1.7.9.GIT
maintainer Applied
#1 lore raw

From: "Ariel Elior" <[email protected]>
Date: Wed, 9 Jan 2013 19:04:35 +0200

Quoted 8 lines

Static checkers complained that the E1H_FUNC_MAX define is used incorrectly in bnx2x_pretend_func(). The complaint was justified, although its not a real bug, as the first part of the conditional protects us in this case (a real bug would happen if a VF tried to use the pretend func, but there are no VFs in E1H chips).

Applied.