Re: [PATCH] net: hix5hd2_gmac: avoid integer overload warning
From: David Miller
Date: Sun Oct 18 2015 - 22:45:34 EST
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Fri, 16 Oct 2015 12:00:51 +0200
> BITS_RX_EN is an 'unsigned long' constant, so the ones complement of that
> has bits set that do not fit into a 32-bit variable on 64-bit architectures,
> which causes a harmless gcc warning:
>
> drivers/net/ethernet/hisilicon/hix5hd2_gmac.c: In function 'hix5hd2_port_disable':
> drivers/net/ethernet/hisilicon/hix5hd2_gmac.c:374:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> writel_relaxed(~(BITS_RX_EN | BITS_TX_EN), priv->base + PORT_EN);
>
> This adds a cast to (u32) to tell gcc that the code is indeed fine.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/