summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2020-01-28 10:50:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-29 16:43:25 +0100
commit4149c8693a8c23947cb60d7c1d177e9d93e6481e (patch)
treeeab42235af5a62eb49c42d94ba07b6b4542d8552 /arch/s390/mm
parentaa2e8b68f24462ceb1c495cbde642a174c80fe55 (diff)
downloadlinux-stable-4149c8693a8c23947cb60d7c1d177e9d93e6481e.tar.gz
linux-stable-4149c8693a8c23947cb60d7c1d177e9d93e6481e.tar.bz2
linux-stable-4149c8693a8c23947cb60d7c1d177e9d93e6481e.zip
drivers/base/memory.c: remove an unnecessary check on NR_MEM_SECTIONS
commit 3b6fd6ffb27c2efa003c6d4d15ca72c054b71d7c upstream. In cb5e39b8038b ("drivers: base: refactor add_memory_section() to add_memory_block()"), add_memory_block() is introduced, which is only invoked in memory_dev_init(). When combining these two loops in memory_dev_init() and add_memory_block(), they looks like this: for (i = 0; i < NR_MEM_SECTIONS; i += sections_per_block) for (j = i; (j < i + sections_per_block) && j < NR_MEM_SECTIONS; j++) Since it is sure the (i < NR_MEM_SECTIONS) and j sits in its own memory block, the check of (j < NR_MEM_SECTIONS) is not necessary. This patch just removes this check. Link: http://lkml.kernel.org/r/20181123222811.18216-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Seth Jennings <sjenning@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/s390/mm')
0 files changed, 0 insertions, 0 deletions