aboutsummaryrefslogtreecommitdiffstats
path: root/mm/kmemleak.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2016-03-17 17:19:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 18:09:34 -0400
commit756a025f00091918d9d09ca3229defb160b409c0 (patch)
treed4a6914597ef4b10870a7983bb61cd595e7094a2 /mm/kmemleak.c
parent598d80914e84fa79580850530f5d4a50a99bf4f5 (diff)
mm: coalesce split strings
Kernel style prefers a single string over split strings when the string is 'user-visible'. Miscellanea: - Add a missing newline - Realign arguments Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Tejun Heo <tj@kernel.org> [percpu] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/kmemleak.c')
-rw-r--r--mm/kmemleak.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index a81cd76ea282..e6429926e957 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -596,8 +596,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
596 else if (parent->pointer + parent->size <= ptr) 596 else if (parent->pointer + parent->size <= ptr)
597 link = &parent->rb_node.rb_right; 597 link = &parent->rb_node.rb_right;
598 else { 598 else {
599 kmemleak_stop("Cannot insert 0x%lx into the object " 599 kmemleak_stop("Cannot insert 0x%lx into the object search tree (overlaps existing)\n",
600 "search tree (overlaps existing)\n",
601 ptr); 600 ptr);
602 /* 601 /*
603 * No need for parent->lock here since "parent" cannot 602 * No need for parent->lock here since "parent" cannot
@@ -670,8 +669,8 @@ static void delete_object_part(unsigned long ptr, size_t size)
670 object = find_and_remove_object(ptr, 1); 669 object = find_and_remove_object(ptr, 1);
671 if (!object) { 670 if (!object) {
672#ifdef DEBUG 671#ifdef DEBUG
673 kmemleak_warn("Partially freeing unknown object at 0x%08lx " 672 kmemleak_warn("Partially freeing unknown object at 0x%08lx (size %zu)\n",
674 "(size %zu)\n", ptr, size); 673 ptr, size);
675#endif 674#endif
676 return; 675 return;
677 } 676 }
@@ -717,8 +716,8 @@ static void paint_ptr(unsigned long ptr, int color)
717 716
718 object = find_and_get_object(ptr, 0); 717 object = find_and_get_object(ptr, 0);
719 if (!object) { 718 if (!object) {
720 kmemleak_warn("Trying to color unknown object " 719 kmemleak_warn("Trying to color unknown object at 0x%08lx as %s\n",
721 "at 0x%08lx as %s\n", ptr, 720 ptr,
722 (color == KMEMLEAK_GREY) ? "Grey" : 721 (color == KMEMLEAK_GREY) ? "Grey" :
723 (color == KMEMLEAK_BLACK) ? "Black" : "Unknown"); 722 (color == KMEMLEAK_BLACK) ? "Black" : "Unknown");
724 return; 723 return;
@@ -1463,8 +1462,8 @@ static void kmemleak_scan(void)
1463 if (new_leaks) { 1462 if (new_leaks) {
1464 kmemleak_found_leaks = true; 1463 kmemleak_found_leaks = true;
1465 1464
1466 pr_info("%d new suspected memory leaks (see " 1465 pr_info("%d new suspected memory leaks (see /sys/kernel/debug/kmemleak)\n",
1467 "/sys/kernel/debug/kmemleak)\n", new_leaks); 1466 new_leaks);
1468 } 1467 }
1469 1468
1470} 1469}
@@ -1795,8 +1794,7 @@ static void kmemleak_do_cleanup(struct work_struct *work)
1795 if (!kmemleak_found_leaks) 1794 if (!kmemleak_found_leaks)
1796 __kmemleak_do_cleanup(); 1795 __kmemleak_do_cleanup();
1797 else 1796 else
1798 pr_info("Kmemleak disabled without freeing internal data. " 1797 pr_info("Kmemleak disabled without freeing internal data. Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\".\n");
1799 "Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\"\n");
1800} 1798}
1801 1799
1802static DECLARE_WORK(cleanup_work, kmemleak_do_cleanup); 1800static DECLARE_WORK(cleanup_work, kmemleak_do_cleanup);