forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
5 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
* Address space accounting code <[email protected]> | ||
*/ | ||
|
||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/slab.h> | ||
#include <linux/backing-dev.h> | ||
|
@@ -37,6 +39,7 @@ | |
#include <linux/sched/sysctl.h> | ||
#include <linux/notifier.h> | ||
#include <linux/memory.h> | ||
#include <linux/printk.h> | ||
|
||
#include <asm/uaccess.h> | ||
#include <asm/cacheflush.h> | ||
|
@@ -361,20 +364,20 @@ static int browse_rb(struct rb_root *root) | |
struct vm_area_struct *vma; | ||
vma = rb_entry(nd, struct vm_area_struct, vm_rb); | ||
if (vma->vm_start < prev) { | ||
printk("vm_start %lx prev %lx\n", vma->vm_start, prev); | ||
pr_info("vm_start %lx prev %lx\n", vma->vm_start, prev); | ||
bug = 1; | ||
} | ||
if (vma->vm_start < pend) { | ||
printk("vm_start %lx pend %lx\n", vma->vm_start, pend); | ||
pr_info("vm_start %lx pend %lx\n", vma->vm_start, pend); | ||
bug = 1; | ||
} | ||
if (vma->vm_start > vma->vm_end) { | ||
printk("vm_end %lx < vm_start %lx\n", | ||
pr_info("vm_end %lx < vm_start %lx\n", | ||
vma->vm_end, vma->vm_start); | ||
bug = 1; | ||
} | ||
if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { | ||
printk("free gap %lx, correct %lx\n", | ||
pr_info("free gap %lx, correct %lx\n", | ||
vma->rb_subtree_gap, | ||
vma_compute_subtree_gap(vma)); | ||
bug = 1; | ||
|
@@ -388,7 +391,7 @@ static int browse_rb(struct rb_root *root) | |
for (nd = pn; nd; nd = rb_prev(nd)) | ||
j++; | ||
if (i != j) { | ||
printk("backwards %d, forwards %d\n", j, i); | ||
pr_info("backwards %d, forwards %d\n", j, i); | ||
bug = 1; | ||
} | ||
return bug ? -1 : i; | ||
|
@@ -423,17 +426,17 @@ static void validate_mm(struct mm_struct *mm) | |
i++; | ||
} | ||
if (i != mm->map_count) { | ||
printk("map_count %d vm_next %d\n", mm->map_count, i); | ||
pr_info("map_count %d vm_next %d\n", mm->map_count, i); | ||
bug = 1; | ||
} | ||
if (highest_address != mm->highest_vm_end) { | ||
printk("mm->highest_vm_end %lx, found %lx\n", | ||
pr_info("mm->highest_vm_end %lx, found %lx\n", | ||
mm->highest_vm_end, highest_address); | ||
bug = 1; | ||
} | ||
i = browse_rb(&mm->mm_rb); | ||
if (i != mm->map_count) { | ||
printk("map_count %d rb %d\n", mm->map_count, i); | ||
pr_info("map_count %d rb %d\n", mm->map_count, i); | ||
bug = 1; | ||
} | ||
BUG_ON(bug); | ||
|
@@ -3280,7 +3283,7 @@ static struct notifier_block reserve_mem_nb = { | |
static int __meminit init_reserve_notifier(void) | ||
{ | ||
if (register_hotmemory_notifier(&reserve_mem_nb)) | ||
printk("Failed registering memory add/remove notifier for admin reserve"); | ||
pr_err("Failed registering memory add/remove notifier for admin reserve\n"); | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ | |
* Copyright (c) 2007-2010 Paul Mundt <[email protected]> | ||
*/ | ||
|
||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
|
||
#include <linux/export.h> | ||
#include <linux/mm.h> | ||
#include <linux/vmacache.h> | ||
|
@@ -32,6 +34,7 @@ | |
#include <linux/syscalls.h> | ||
#include <linux/audit.h> | ||
#include <linux/sched/sysctl.h> | ||
#include <linux/printk.h> | ||
|
||
#include <asm/uaccess.h> | ||
#include <asm/tlb.h> | ||
|
@@ -1246,7 +1249,7 @@ static int do_mmap_private(struct vm_area_struct *vma, | |
return ret; | ||
|
||
enomem: | ||
printk("Allocation of length %lu from process %d (%s) failed\n", | ||
pr_err("Allocation of length %lu from process %d (%s) failed\n", | ||
len, current->pid, current->comm); | ||
show_free_areas(0); | ||
return -ENOMEM; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters