x86-32: Fix sparse warning for the __PHYSICAL_MASK calculation
authorNamhyung Kim <namhyung@gmail.com>
Wed, 29 Sep 2010 14:29:48 +0000 (23:29 +0900)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 7 Oct 2010 23:36:17 +0000 (16:36 -0700)
commita416e9e1dde0fbcf20cda59df284cc0dcf2aadc4
tree65385bf8cdc8455745e3a3f5fbf2e7de8d61a45c
parent161b0275e2311b8bd9609d5f32e2b703cf5d70a8
x86-32: Fix sparse warning for the __PHYSICAL_MASK calculation

On 32-bit non-PAE system, cast to 'phys_addr_t' truncates value
before subtraction. Subtracting before cast produce same result
but remove following warnings from sparse:

 arch/x86/include/asm/pgtable_types.h:255:38: warning: cast truncates bits from constant value (100000000 becomes 0)
 arch/x86/include/asm/pgtable_types.h:270:38: warning: cast truncates bits from constant value (100000000 becomes 0)
 arch/x86/include/asm/pgtable.h:127:32: warning: cast truncates bits from constant value (100000000 becomes 0)
 arch/x86/include/asm/pgtable.h:132:32: warning: cast truncates bits from constant value (100000000 becomes 0)
 arch/x86/include/asm/pgtable.h:344:31: warning: cast truncates bits from constant value (100000000 becomes 0)

64-bit or PAE machines will not be affected by this change.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
LKML-Reference: <1285770588-14065-1-git-send-email-namhyung@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/page_types.h