]> git.hungrycats.org Git - linux/commitdiff
spi/pl022: Explicitly truncate large bitmask
authorMark Brown <broonie@linaro.org>
Fri, 1 Aug 2014 16:47:38 +0000 (17:47 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:33:47 +0000 (13:33 +0000)
commit d555ea05f9d8ebf567eaa6b4e4cb5776aacf2940 upstream.

When building on 64 bit architectures the use of bitwise negation generates
constants larger than 32 bits which won't fit in u32s used to represent
32 bit register values on the device. Explicitly cast to let the compiler
know that the higher bits are not significant and can be discarded.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/spi/spi-pl022.c

index 02798036df8f280c3478b23addd776a8e7844bc6..53a908e4219f6e380d4b764c381dcebc54007419 100644 (file)
@@ -1417,7 +1417,7 @@ static void do_interrupt_dma_transfer(struct pl022 *pl022)
         * Default is to enable all interrupts except RX -
         * this will be enabled once TX is complete
         */
-       u32 irqflags = ENABLE_ALL_INTERRUPTS & ~SSP_IMSC_MASK_RXIM;
+       u32 irqflags = (u32)(ENABLE_ALL_INTERRUPTS & ~SSP_IMSC_MASK_RXIM);
 
        /* Enable target chip, if not already active */
        if (!pl022->next_msg_cs_active)