]> git.baikalelectronics.ru Git - kernel.git/commit
include/linux/mmzone.h: avoid a warning in sparse memory support
authorMatthew Wilcox <willy@infradead.org>
Thu, 2 Sep 2021 21:57:10 +0000 (14:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 16:58:14 +0000 (09:58 -0700)
commit0c535e51453b6d6dfb90d5eb50e729674084e7e6
treefababf9b366984b2171605dc3efd04a69ecffd1f
parent87d1e5393fc5c3da290d16fd0f3d1ebadc2e9801
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: Linus Torvalds <torvalds@linux-foundation.org>
mm/sparse.c