diff options
author | Mitchel Humpherys <mitchelh@codeaurora.org> | 2014-06-06 17:38:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:18 -0400 |
commit | b1de0d139c97a6078bbada6cf2d27c30ce127a97 (patch) | |
tree | 3b318e167b70e14d73278c213e3e5e4e89566773 /mm | |
parent | b3fe92b03dd69261f931fe4463d9358e5077e1dc (diff) |
mm: convert some level-less printks to pr_*
printk is meant to be used with an associated log level. There are some
instances of printk scattered around the mm code where the log level is
missing. Add a log level and adhere to suggestions by
scripts/checkpatch.pl by moving to the pr_* macros.
Also add the typical pr_fmt definition so that print statements can be
easily traced back to the modules where they occur, correlated one with
another, etc. This will require the removal of some (now redundant)
prefixes on a few print statements.
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 5 | ||||
-rw-r--r-- | mm/mmap.c | 21 | ||||
-rw-r--r-- | mm/nommu.c | 5 | ||||
-rw-r--r-- | mm/vmscan.c | 5 |
4 files changed, 24 insertions, 12 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 16bc9fa42998..1c16c228f35a 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -65,6 +65,8 @@ | |||
65 | kernel is not always grateful with that. | 65 | kernel is not always grateful with that. |
66 | */ | 66 | */ |
67 | 67 | ||
68 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
69 | |||
68 | #include <linux/mempolicy.h> | 70 | #include <linux/mempolicy.h> |
69 | #include <linux/mm.h> | 71 | #include <linux/mm.h> |
70 | #include <linux/highmem.h> | 72 | #include <linux/highmem.h> |
@@ -91,6 +93,7 @@ | |||
91 | #include <linux/ctype.h> | 93 | #include <linux/ctype.h> |
92 | #include <linux/mm_inline.h> | 94 | #include <linux/mm_inline.h> |
93 | #include <linux/mmu_notifier.h> | 95 | #include <linux/mmu_notifier.h> |
96 | #include <linux/printk.h> | ||
94 | 97 | ||
95 | #include <asm/tlbflush.h> | 98 | #include <asm/tlbflush.h> |
96 | #include <asm/uaccess.h> | 99 | #include <asm/uaccess.h> |
@@ -2645,7 +2648,7 @@ void __init numa_policy_init(void) | |||
2645 | node_set(prefer, interleave_nodes); | 2648 | node_set(prefer, interleave_nodes); |
2646 | 2649 | ||
2647 | if (do_set_mempolicy(MPOL_INTERLEAVE, 0, &interleave_nodes)) | 2650 | if (do_set_mempolicy(MPOL_INTERLEAVE, 0, &interleave_nodes)) |
2648 | printk("numa_policy_init: interleaving failed\n"); | 2651 | pr_err("%s: interleaving failed\n", __func__); |
2649 | 2652 | ||
2650 | check_numabalancing_enable(); | 2653 | check_numabalancing_enable(); |
2651 | } | 2654 | } |
@@ -6,6 +6,8 @@ | |||
6 | * Address space accounting code <alan@lxorguk.ukuu.org.uk> | 6 | * Address space accounting code <alan@lxorguk.ukuu.org.uk> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
10 | |||
9 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
10 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
11 | #include <linux/backing-dev.h> | 13 | #include <linux/backing-dev.h> |
@@ -37,6 +39,7 @@ | |||
37 | #include <linux/sched/sysctl.h> | 39 | #include <linux/sched/sysctl.h> |
38 | #include <linux/notifier.h> | 40 | #include <linux/notifier.h> |
39 | #include <linux/memory.h> | 41 | #include <linux/memory.h> |
42 | #include <linux/printk.h> | ||
40 | 43 | ||
41 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
42 | #include <asm/cacheflush.h> | 45 | #include <asm/cacheflush.h> |
@@ -361,20 +364,20 @@ static int browse_rb(struct rb_root *root) | |||
361 | struct vm_area_struct *vma; | 364 | struct vm_area_struct *vma; |
362 | vma = rb_entry(nd, struct vm_area_struct, vm_rb); | 365 | vma = rb_entry(nd, struct vm_area_struct, vm_rb); |
363 | if (vma->vm_start < prev) { | 366 | if (vma->vm_start < prev) { |
364 | printk("vm_start %lx prev %lx\n", vma->vm_start, prev); | 367 | pr_info("vm_start %lx prev %lx\n", vma->vm_start, prev); |
365 | bug = 1; | 368 | bug = 1; |
366 | } | 369 | } |
367 | if (vma->vm_start < pend) { | 370 | if (vma->vm_start < pend) { |
368 | printk("vm_start %lx pend %lx\n", vma->vm_start, pend); | 371 | pr_info("vm_start %lx pend %lx\n", vma->vm_start, pend); |
369 | bug = 1; | 372 | bug = 1; |
370 | } | 373 | } |
371 | if (vma->vm_start > vma->vm_end) { | 374 | if (vma->vm_start > vma->vm_end) { |
372 | printk("vm_end %lx < vm_start %lx\n", | 375 | pr_info("vm_end %lx < vm_start %lx\n", |
373 | vma->vm_end, vma->vm_start); | 376 | vma->vm_end, vma->vm_start); |
374 | bug = 1; | 377 | bug = 1; |
375 | } | 378 | } |
376 | if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { | 379 | if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { |
377 | printk("free gap %lx, correct %lx\n", | 380 | pr_info("free gap %lx, correct %lx\n", |
378 | vma->rb_subtree_gap, | 381 | vma->rb_subtree_gap, |
379 | vma_compute_subtree_gap(vma)); | 382 | vma_compute_subtree_gap(vma)); |
380 | bug = 1; | 383 | bug = 1; |
@@ -388,7 +391,7 @@ static int browse_rb(struct rb_root *root) | |||
388 | for (nd = pn; nd; nd = rb_prev(nd)) | 391 | for (nd = pn; nd; nd = rb_prev(nd)) |
389 | j++; | 392 | j++; |
390 | if (i != j) { | 393 | if (i != j) { |
391 | printk("backwards %d, forwards %d\n", j, i); | 394 | pr_info("backwards %d, forwards %d\n", j, i); |
392 | bug = 1; | 395 | bug = 1; |
393 | } | 396 | } |
394 | return bug ? -1 : i; | 397 | return bug ? -1 : i; |
@@ -423,17 +426,17 @@ static void validate_mm(struct mm_struct *mm) | |||
423 | i++; | 426 | i++; |
424 | } | 427 | } |
425 | if (i != mm->map_count) { | 428 | if (i != mm->map_count) { |
426 | printk("map_count %d vm_next %d\n", mm->map_count, i); | 429 | pr_info("map_count %d vm_next %d\n", mm->map_count, i); |
427 | bug = 1; | 430 | bug = 1; |
428 | } | 431 | } |
429 | if (highest_address != mm->highest_vm_end) { | 432 | if (highest_address != mm->highest_vm_end) { |
430 | printk("mm->highest_vm_end %lx, found %lx\n", | 433 | pr_info("mm->highest_vm_end %lx, found %lx\n", |
431 | mm->highest_vm_end, highest_address); | 434 | mm->highest_vm_end, highest_address); |
432 | bug = 1; | 435 | bug = 1; |
433 | } | 436 | } |
434 | i = browse_rb(&mm->mm_rb); | 437 | i = browse_rb(&mm->mm_rb); |
435 | if (i != mm->map_count) { | 438 | if (i != mm->map_count) { |
436 | printk("map_count %d rb %d\n", mm->map_count, i); | 439 | pr_info("map_count %d rb %d\n", mm->map_count, i); |
437 | bug = 1; | 440 | bug = 1; |
438 | } | 441 | } |
439 | BUG_ON(bug); | 442 | BUG_ON(bug); |
@@ -3280,7 +3283,7 @@ static struct notifier_block reserve_mem_nb = { | |||
3280 | static int __meminit init_reserve_notifier(void) | 3283 | static int __meminit init_reserve_notifier(void) |
3281 | { | 3284 | { |
3282 | if (register_hotmemory_notifier(&reserve_mem_nb)) | 3285 | if (register_hotmemory_notifier(&reserve_mem_nb)) |
3283 | printk("Failed registering memory add/remove notifier for admin reserve"); | 3286 | pr_err("Failed registering memory add/remove notifier for admin reserve\n"); |
3284 | 3287 | ||
3285 | return 0; | 3288 | return 0; |
3286 | } | 3289 | } |
diff --git a/mm/nommu.c b/mm/nommu.c index 85f8d6698d48..b78e3a8f5ee7 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -13,6 +13,8 @@ | |||
13 | * Copyright (c) 2007-2010 Paul Mundt <lethal@linux-sh.org> | 13 | * Copyright (c) 2007-2010 Paul Mundt <lethal@linux-sh.org> |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
17 | |||
16 | #include <linux/export.h> | 18 | #include <linux/export.h> |
17 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
18 | #include <linux/vmacache.h> | 20 | #include <linux/vmacache.h> |
@@ -32,6 +34,7 @@ | |||
32 | #include <linux/syscalls.h> | 34 | #include <linux/syscalls.h> |
33 | #include <linux/audit.h> | 35 | #include <linux/audit.h> |
34 | #include <linux/sched/sysctl.h> | 36 | #include <linux/sched/sysctl.h> |
37 | #include <linux/printk.h> | ||
35 | 38 | ||
36 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
37 | #include <asm/tlb.h> | 40 | #include <asm/tlb.h> |
@@ -1246,7 +1249,7 @@ error_free: | |||
1246 | return ret; | 1249 | return ret; |
1247 | 1250 | ||
1248 | enomem: | 1251 | enomem: |
1249 | printk("Allocation of length %lu from process %d (%s) failed\n", | 1252 | pr_err("Allocation of length %lu from process %d (%s) failed\n", |
1250 | len, current->pid, current->comm); | 1253 | len, current->pid, current->comm); |
1251 | show_free_areas(0); | 1254 | show_free_areas(0); |
1252 | return -ENOMEM; | 1255 | return -ENOMEM; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index f44476a41544..71f23c0c1090 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * Multiqueue VM started 5.8.00, Rik van Riel. | 11 | * Multiqueue VM started 5.8.00, Rik van Riel. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
14 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/gfp.h> | 18 | #include <linux/gfp.h> |
@@ -43,6 +45,7 @@ | |||
43 | #include <linux/sysctl.h> | 45 | #include <linux/sysctl.h> |
44 | #include <linux/oom.h> | 46 | #include <linux/oom.h> |
45 | #include <linux/prefetch.h> | 47 | #include <linux/prefetch.h> |
48 | #include <linux/printk.h> | ||
46 | 49 | ||
47 | #include <asm/tlbflush.h> | 50 | #include <asm/tlbflush.h> |
48 | #include <asm/div64.h> | 51 | #include <asm/div64.h> |
@@ -480,7 +483,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping, | |||
480 | if (page_has_private(page)) { | 483 | if (page_has_private(page)) { |
481 | if (try_to_free_buffers(page)) { | 484 | if (try_to_free_buffers(page)) { |
482 | ClearPageDirty(page); | 485 | ClearPageDirty(page); |
483 | printk("%s: orphaned page\n", __func__); | 486 | pr_info("%s: orphaned page\n", __func__); |
484 | return PAGE_CLEAN; | 487 | return PAGE_CLEAN; |
485 | } | 488 | } |
486 | } | 489 | } |