]> git.baikalelectronics.ru Git - uboot.git/commit
bitops: Fix GENMASK definition for Sandbox
authorVignesh R <vigneshr@ti.com>
Tue, 5 Feb 2019 05:59:11 +0000 (11:29 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 7 Feb 2019 10:03:21 +0000 (15:33 +0530)
commit750b77f225102dd82f1878fb856a86b0fa84b9c2
tree31e73ed3736140743d285233995c8111f7dc2e0d
parenta6eb4ffb280d1f3d90c6c14114ca4156500ca546
bitops: Fix GENMASK definition for Sandbox

In arch/sandbox/include/asm/types.h we have
Therefore for 32 bit Sandbox build BITS_PER_LONG turns out to be 32 as
CONFIG_PHYS64 is not set

This messes up the current logic of GENMASK macro due to mismatch b/w
size of unsigned long (64 bit) and that of BITS_PER_LONG.
Fix this by using CONFIG_SANDBOX_BITS_PER_LONG which is set to 64/32
based on the host machine on which its being compiled.

Without this patch:
GENMASK(14,0) => 0x7fffffffffff
After this patch:
GENMASK(14,0) => 0x7fff

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
include/linux/bitops.h