]> git.baikalelectronics.ru Git - kernel.git/commit
stmmac: dwmac-ipq806x: fix static checker warning
authorMathieu Olivari <mathieu@codeaurora.org>
Wed, 5 Aug 2015 00:25:02 +0000 (17:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Aug 2015 07:12:04 +0000 (00:12 -0700)
commit9388790a798e72a7d255ad5ce843ed546377909f
treea8018d8e88e722959749aa97ad61e5a1723f9977
parenteea4404d8d129b56dc96ccb7d695ba34a6e565d1
stmmac: dwmac-ipq806x: fix static checker warning

The patch 1b7eef4ba5ce: "stmmac: add ipq806x glue layer", leads to the
following static checker warning:

.../stmmac/dwmac-ipq806x.c:314 ipq806x_gmac_probe()
warn: double left shift '1 << (1 << gmac->id)'

The NSS_COMMON_CLK_SRC_CTRL_OFFSET macro is used once as an offset, and
once as a mask, which is a bug indeed. We'll fix it by defining the
offset as the real offset value and computing the mask from it when
required.

Tested on IPQ806x ref designs AP148 & DB149.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c