Re: [PATCH] spi: fix SPI_BIT_MASK() to use correct size for 32-bittransfer mask

From: Mika Westerberg
Date: Wed Aug 21 2013 - 03:39:35 EST


On Tue, Aug 20, 2013 at 10:37:34AM -0600, Stephen Warren wrote:
> On 08/20/2013 06:15 AM, Mika Westerberg wrote:
> > When building a 64-bit kernel we get the following warning from the
> > compiler:
> >
> > drivers/spi/spi-pxa2xx.c: In function âpxa2xx_spi_probeâ:
> > drivers/spi/spi-pxa2xx.c:1152:3: warning: large integer implicitly truncated to unsigned type [-Woverflow]
> > master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
> > ^
> > This is due the fact that when the max range is specified as 32
> > SPI_BIT_MASK() expands to ~0UL which doesn't fit to the u32 type that the
> > master->bits_per_word_mask is.
> >
> > Fix this by using ~0U instead.
>
> The same patch is already in next-20130819 at least, as:
> b6aa23c spi: fix SPI_BIT_MASK so it always fits into 32-bits

Cool :) Thanks for letting me know.
--
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/