Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/iommu-common.c: do not use 0xffffffffffffffffl for computing align_mask

Using a 64 bit constant generates "warning: integer constant is too
large for 'long' type" on 32 bit platforms. Instead use ~0ul and
BITS_PER_LONG.

Detected by Andrew Morton on ARMD.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Sowmini Varadhan and committed by
Linus Torvalds
447f6a95 3e810ae2

+1 -1
+1 -1
lib/iommu-common.c
··· 119 119 unsigned long align_mask = 0; 120 120 121 121 if (align_order > 0) 122 - align_mask = 0xffffffffffffffffl >> (64 - align_order); 122 + align_mask = ~0ul >> (BITS_PER_LONG - align_order); 123 123 124 124 /* Sanity check */ 125 125 if (unlikely(npages == 0)) {