netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bnx2x: align define usage to satisfy static checkers
@ 2013-01-09 17:04 Ariel Elior
  2013-01-10 22:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ariel Elior @ 2013-01-09 17:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ariel Elior

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).

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 5fcaee1..8740b52 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -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 */
-- 
1.7.9.GIT

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] bnx2x: align define usage to satisfy static checkers
  2013-01-09 17:04 [PATCH net-next] bnx2x: align define usage to satisfy static checkers Ariel Elior
@ 2013-01-10 22:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-10 22:40 UTC (permalink / raw)
  To: ariele; +Cc: netdev

From: "Ariel Elior" <ariele@broadcom.com>
Date: Wed, 9 Jan 2013 19:04:35 +0200

> 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).
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-10 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 17:04 [PATCH net-next] bnx2x: align define usage to satisfy static checkers Ariel Elior
2013-01-10 22:40 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).