aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorMitchel Humpherys <mitchelh@codeaurora.org>2014-06-06 17:38:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:18 -0400
commitb1de0d139c97a6078bbada6cf2d27c30ce127a97 (patch)
tree3b318e167b70e14d73278c213e3e5e4e89566773 /mm/mmap.c
parentb3fe92b03dd69261f931fe4463d9358e5077e1dc (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/mmap.c')
-rw-r--r--mm/mmap.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index ced5efcdd4b6..129b847d30cc 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -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 = {
3280static int __meminit init_reserve_notifier(void) 3283static 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}