Skip to content

Commit

Permalink
bnx2x: align define usage to satisfy static checkers
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ariel Elior authored and David S. Miller committed Jan 10, 2013
1 parent 2efd32e commit 2382685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13360,7 +13360,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 */
Expand Down

0 comments on commit 2382685

Please sign in to comment.