From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Thu, 12 Nov 2015 15:12:48 +0100 Subject: [PATCH] stmmac: avoid ipq806x constant overflow warning Message-ID: <4391788.dtYArQ4mVi@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Building dwmac-ipq806x on a 64-bit architecture produces a harmless warning from gcc: stmmac/dwmac-ipq806x.c: In function 'ipq806x_gmac_probe': include/linux/bitops.h:6:19: warning: overflow in implicit constant conversion [-Woverflow] val = QSGMII_PHY_CDR_EN | stmmac/dwmac-ipq806x.c:333:8: note: in expansion of macro 'QSGMII_PHY_CDR_EN' #define QSGMII_PHY_CDR_EN BIT(0) #define BIT(nr) (1UL << (nr)) The compiler warns about the fact that a 64-bit literal is passed into a function that takes a 32-bit argument. I could not fully understand why it warns despite the fact that this number is always small enough to fit, but changing the use of BIT() macros into the equivalent hexadecimal representation avoids the warning Signed-off-by: Arnd Bergmann Fixes: b1c17215d718 ("stmmac: add ipq806x glue layer") --- This came up on the arm64 allmodconfig build diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c index 9d89bdbf029f..4abd9b0b542a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c @@ -77,11 +77,11 @@ /* Only GMAC1/2/3 support SGMII and their CTL register are not contiguous */ #define QSGMII_PHY_SGMII_CTL(x) ((x == 1) ? 0x134 : \ (0x13c + (4 * (x - 2)))) -#define QSGMII_PHY_CDR_EN BIT(0) -#define QSGMII_PHY_RX_FRONT_EN BIT(1) -#define QSGMII_PHY_RX_SIGNAL_DETECT_EN BIT(2) -#define QSGMII_PHY_TX_DRIVER_EN BIT(3) -#define QSGMII_PHY_QSGMII_EN BIT(7) +#define QSGMII_PHY_CDR_EN 0x01u +#define QSGMII_PHY_RX_FRONT_EN 0x02u +#define QSGMII_PHY_RX_SIGNAL_DETECT_EN 0x04u +#define QSGMII_PHY_TX_DRIVER_EN 0x08u +#define QSGMII_PHY_QSGMII_EN 0x80u #define QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET 12 #define QSGMII_PHY_PHASE_LOOP_GAIN_MASK 0x7 #define QSGMII_PHY_RX_DC_BIAS_OFFSET 18 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754276AbbKLONe (ORCPT ); Thu, 12 Nov 2015 09:13:34 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:61375 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbbKLONc (ORCPT ); Thu, 12 Nov 2015 09:13:32 -0500 From: Arnd Bergmann To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mathieu Olivari , "David S. Miller" , Giuseppe Cavallaro Subject: [PATCH] stmmac: avoid ipq806x constant overflow warning Date: Thu, 12 Nov 2015 15:12:48 +0100 Message-ID: <4391788.dtYArQ4mVi@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:DPYP1ulZrBCa9GG5ZrpkG5JtrXcBJQHxyGI99p4urd3bCQmbZg3 cf+Dg4SsVk9I6N1dh+GZkDZkr8iFVj17Jfeaav1yXY4AAxPDbaIDjhZHYg8Dq7PXq3jtfVD rjhSWDM2UX0uMEzBgUkM1+bnQabS8iLXjJTsLZ/YmfA7UxNvb/d233+AllXb0hcP0TWQPbu yoZ2eVNwWPk27I2q0LEhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:7QzLQpTs6pY=:D2+RaSSZWKwmXlyDAbwzMd uY2IYQDXVNXkOJdmY+38cFnftYIoTsCvM5i/bHh1fQFc+6LavKBFJl7a0shpkSN1uIdKsb1Il 228qGHkjFatFmQCZhsL+/o+NgwPOj005LmOJB4eGyPrFE7eTD1+Ip4l9iVwHXxUjrbDI8SJaQ dgrtIVWyxpGrrgOrxYkFuJPL/IKevW596GCd8ZY/P9in1KCZpAFVXsBf7orJzE5cKoE9WhubS PnBlNWgkxiTRH2Q5piB4eo3Ipm5Y+uSrLZaSFD2XJ4XNA29oUW8VAq9kXOd3e9qJAoiDiswOU YAyqZ5PKaTbH9xEzFJsNPkhBYMecAO2nGR56TzwaL49JpYujn5IPdgLxEErOXt8QCt32qZdHJ 70JloSubj2FwoU2EHByK9VOH5aNLiD3lgIcV5kLsH1fQrQXzhJ5nZRMf8t+hZdWkEAZmL9ZnZ gJbVgQBMS7yVzCUjbr8/Qm3pHmW5aSyVwmvctanNTThtcNJI2Wum7thTQ6pzWyjFMInpjb4cD halnXKOjTdUXz/TOjW5AWJ3aoAFhETlvdWMYscb/BbsbehkjTEXrxs+dY3JpnE6aClZFVJozi W4254LcVwZKyx0YmEJ5rRzSL5VX0iTiVpJc5WWZT5woRB61qyydqGbHmhkitQk9vucHnBaH8D ZVRNuuQlEy7TxIAtXSPFgzO5AhU23mijjJqUodC+k/RKuWcok7Zv+pzNLVGAUp/hWKXJbh8uq Y53KDyY86x9zq4o6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building dwmac-ipq806x on a 64-bit architecture produces a harmless warning from gcc: stmmac/dwmac-ipq806x.c: In function 'ipq806x_gmac_probe': include/linux/bitops.h:6:19: warning: overflow in implicit constant conversion [-Woverflow] val = QSGMII_PHY_CDR_EN | stmmac/dwmac-ipq806x.c:333:8: note: in expansion of macro 'QSGMII_PHY_CDR_EN' #define QSGMII_PHY_CDR_EN BIT(0) #define BIT(nr) (1UL << (nr)) The compiler warns about the fact that a 64-bit literal is passed into a function that takes a 32-bit argument. I could not fully understand why it warns despite the fact that this number is always small enough to fit, but changing the use of BIT() macros into the equivalent hexadecimal representation avoids the warning Signed-off-by: Arnd Bergmann Fixes: b1c17215d718 ("stmmac: add ipq806x glue layer") --- This came up on the arm64 allmodconfig build diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c index 9d89bdbf029f..4abd9b0b542a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c @@ -77,11 +77,11 @@ /* Only GMAC1/2/3 support SGMII and their CTL register are not contiguous */ #define QSGMII_PHY_SGMII_CTL(x) ((x == 1) ? 0x134 : \ (0x13c + (4 * (x - 2)))) -#define QSGMII_PHY_CDR_EN BIT(0) -#define QSGMII_PHY_RX_FRONT_EN BIT(1) -#define QSGMII_PHY_RX_SIGNAL_DETECT_EN BIT(2) -#define QSGMII_PHY_TX_DRIVER_EN BIT(3) -#define QSGMII_PHY_QSGMII_EN BIT(7) +#define QSGMII_PHY_CDR_EN 0x01u +#define QSGMII_PHY_RX_FRONT_EN 0x02u +#define QSGMII_PHY_RX_SIGNAL_DETECT_EN 0x04u +#define QSGMII_PHY_TX_DRIVER_EN 0x08u +#define QSGMII_PHY_QSGMII_EN 0x80u #define QSGMII_PHY_PHASE_LOOP_GAIN_OFFSET 12 #define QSGMII_PHY_PHASE_LOOP_GAIN_MASK 0x7 #define QSGMII_PHY_RX_DC_BIAS_OFFSET 18