linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@leon.nu>
To: dhowells@redhat.com, akpm@linux-foundation.org, aarcange@redhat.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Leon Romanovsky <leon@leon.nu>
Subject: [PATCH] mm: nommu: convert kenter/kleave/kdebug macros to use pr_devel()
Date: Mon, 18 May 2015 21:32:33 +0300	[thread overview]
Message-ID: <1431973953-21604-1-git-send-email-leon@leon.nu> (raw)

kenter/kleave/kdebug are wrapper macros to print functions flow and debug
information. This set was written before pr_devel() was introduced, so
it was controlled by "#if 0" construction.

This patch refactors the current macros to use general pr_devel()
functions which won't be compiled in if "#define DEBUG" is not declared
prior to that macros.

Signed-off-by: Leon Romanovsky <leon@leon.nu>
---
 mm/nommu.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index e544508..7e5986b6 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -42,21 +42,15 @@
 #include <asm/mmu_context.h>
 #include "internal.h"
 
-#if 0
-#define kenter(FMT, ...) \
-	printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__)
-#define kleave(FMT, ...) \
-	printk(KERN_DEBUG "<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
-#define kdebug(FMT, ...) \
-	printk(KERN_DEBUG "xxx" FMT"yyy\n", ##__VA_ARGS__)
-#else
+/*
+ * Relies on "#define DEBUG" construction to print them
+ */
 #define kenter(FMT, ...) \
-	no_printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__)
+	pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
 #define kleave(FMT, ...) \
-	no_printk(KERN_DEBUG "<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
+	pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
 #define kdebug(FMT, ...) \
-	no_printk(KERN_DEBUG FMT"\n", ##__VA_ARGS__)
-#endif
+	pr_devel("xxx" FMT"yyy\n", ##__VA_ARGS__)
 
 void *high_memory;
 EXPORT_SYMBOL(high_memory);
-- 
1.7.9.5


             reply	other threads:[~2015-05-18 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 18:32 Leon Romanovsky [this message]
2015-05-18 18:42 [PATCH] mm: nommu: convert kenter/kleave/kdebug macros to use pr_devel() Leon Romanovsky
2015-05-18 18:45 ` Leon Romanovsky
2015-05-18 22:27 ` Andrew Morton
2015-05-19  5:20   ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431973953-21604-1-git-send-email-leon@leon.nu \
    --to=leon@leon.nu \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).