提交 23826850 编写于 作者: A Ariel Elior 提交者: David S. Miller

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAriel Elior <ariele@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2efd32ee
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册