From 9dd7a497147d7e063f80b8905ce3144c8e59173e Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 15 Aug 2018 23:02:08 +0000 Subject: [PATCH] mm-sparse-optimize-memmap-allocation-during-sparse_init-checkpatch-fixes WARNING: 'numner' may be misspelled - perhaps 'number'? #159: FILE: mm/sparse.c:591: + /* The numner of present sections stored in nr_present_sections WARNING: Block comments use a trailing */ on a separate line #167: FILE: mm/sparse.c:599: + * correctly. */ WARNING: line over 80 characters #219: FILE: mm/sparse-vmemmap.c:299: + map_map[nr_consumed_maps] = sparse_mem_map_populate(pnum, nodeid, NULL); total: 0 errors, 3 warnings, 149 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/mm-sparse-optimize-memmap-allocation-during-sparse_init.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Baoquan He Signed-off-by: Andrew Morton --- mm/sparse-vmemmap.c | 3 ++- mm/sparse.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index e1a54ba411ec74..95e2c7638a5cc7 100644 --- a/mm/sparse-vmemmap.c +++ b/mm/sparse-vmemmap.c @@ -296,7 +296,8 @@ void __init sparse_mem_maps_populate_node(struct page **map_map, if (!present_section_nr(pnum)) continue; - map_map[nr_consumed_maps] = sparse_mem_map_populate(pnum, nodeid, NULL); + map_map[nr_consumed_maps] = + sparse_mem_map_populate(pnum, nodeid, NULL); if (map_map[nr_consumed_maps++]) continue; pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", diff --git a/mm/sparse.c b/mm/sparse.c index 0041cd6e07dd69..2ea8b3dbd0dfd1 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -588,7 +588,8 @@ void __init sparse_init(void) sizeof(map_map[0])); #endif - /* The numner of present sections stored in nr_present_sections + /* + * The number of present sections stored in nr_present_sections * are kept the same since mem sections are marked as present in * memory_present(). In this for loop, we need check which sections * failed to allocate memmap or usemap, then clear its @@ -596,7 +597,8 @@ void __init sparse_init(void) * increase 'nr_consumed_maps' whether its allocation of memmap * or usemap failed or not, so that after we handle the i-th * memory section, can get memmap and usemap of (i+1)-th section - * correctly. */ + * correctly. + */ for_each_present_section_nr(0, pnum) { struct mem_section *ms;