From: Ariel Elior Date: Wed, 9 Jan 2013 07:04:35 +0000 (+0000) Subject: bnx2x: align define usage to satisfy static checkers X-Git-Tag: v3.9-rc1~139^2~413 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=238268503f306cdc435eff2181e38c08ce412ed5;p=~emulex%2Finfiniband.git 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). Reported-by: Dan Carpenter Signed-off-by: Ariel Elior Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index c6a208974f2..a296758a6e1 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -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 */