Skip to content

Commit

Permalink
mm-sparse-optimize-memmap-allocation-during-sparse_init-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: 'numner' may be misspelled - perhaps 'number'?
torvalds#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
torvalds#167: FILE: mm/sparse.c:599:
+	 * correctly. */

WARNING: line over 80 characters
torvalds#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 <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
akpm00 authored and sfrothwell committed Jul 14, 2018
1 parent 970b90f commit 092de06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mm/sparse-vmemmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,17 @@ 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
* ->section_mem_map accordingly. During this process, we need
* 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;

Expand Down

0 comments on commit 092de06

Please sign in to comment.