]> www.infradead.org Git - users/jedix/linux-maple.git/commit
include/linux/mmzone.h: avoid a warning in sparse memory support
authorMatthew Wilcox <willy@infradead.org>
Mon, 23 Aug 2021 23:59:23 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:00 +0000 (09:34 +1000)
commit32a617e795a714d12cb732e8ad01e4246eaafc01
tree8fa37c723afab13ab0202cc14affa4deb684a848
parentbf1cbb42dbd214322f695fd9e438106e4938f844
include/linux/mmzone.h: avoid a warning in sparse memory support

cppcheck warns that we're possibly losing information by shifting an int.
It's a false positive, because we don't allow for a NUMA node ID that
large, but if we ever change SECTION_NID_SHIFT, it could become a problem,
and in any case this is usually a legitimate warning.  Fix it by adding
the necessary cast, which makes the compiler generate the right code.

Link: https://lkml.kernel.org/r/YOya+aBZFFmC476e@casper.infradead.org
Link: https://lkml.kernel.org/r/202107130348.6LsVT9Nc-lkp@intel.com
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/sparse.c