mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: james4765@verizon.net
To: linux-kernel@vger.kernel.org
Cc: jgarzik@pobox.com, james4765@verizon.net
Subject: [PATCH] hw_random: Clean up printk()'s in drivers/char/hw_random.c
Date: Mon, 15 Nov 2004 21:28:10 -0600	[thread overview]
Message-ID: <20041116032809.17232.34960.53013@localhost.localdomain> (raw)

Clean up printk()'s in hw_random driver.

Signed-off-by: James Nelson <james4765@gmail.com>

diff -urN --exclude='*~' linux-2.6.10-rc2-original/drivers/char/hw_random.c linux-2.6.10-rc2/drivers/char/hw_random.c
--- linux-2.6.10-rc2-original/drivers/char/hw_random.c	2004-11-15 21:38:16.292353701 -0500
+++ linux-2.6.10-rc2/drivers/char/hw_random.c	2004-11-15 22:18:21.879591411 -0500
@@ -21,6 +21,7 @@
 
  */
 
+#undef DEBUG /* define to enable copious debugging information */
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -56,24 +57,20 @@
 /*
  * debugging macros
  */
-#undef RNG_DEBUG /* define to enable copious debugging info */
 
-#ifdef RNG_DEBUG
-/* note: prints function name for you */
-#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
-#else
-#define DPRINTK(fmt, args...)
-#endif
+/* note: prints function name for you 
+ * collapses to a no-op if DEBUG is #undef */
+#define DPRINTK(fmt, args...) pr_debug( "%s: " fmt, __FUNCTION__ , ## args)
 
-#define RNG_NDEBUG        /* define to disable lightweight runtime checks */
+#undef RNG_NDEBUG        /* define to enable lightweight runtime checks */
 #ifdef RNG_NDEBUG
-#define assert(expr)
+#define assert(expr)						\
+	if(!(expr)) {						\
+	pr_debug( PFX "Assertion failed! %s,%s,%s,line=%d\n",	\
+	#expr,__FILE__,__FUNCTION__,__LINE__);			\
+	}
 #else
-#define assert(expr) \
-        if(!(expr)) {                                   \
-        printk( "Assertion failed! %s,%s,%s,line=%d\n", \
-        #expr,__FILE__,__FUNCTION__,__LINE__);          \
-        }
+#define assert(expr)
 #endif
 
 #define RNG_MISCDEV_MINOR		183 /* official */
@@ -322,7 +319,7 @@
 	rnen |= (1 << 7);	/* PMIO enable */
 	pci_write_config_byte(dev, 0x41, rnen);
 
-	printk(KERN_INFO PFX "AMD768 system management I/O registers at 0x%X.\n", pmbase);
+	pr_info(PFX "AMD768 system management I/O registers at 0x%X.\n", pmbase);
 
 	amd_dev = dev;
 
@@ -606,7 +603,7 @@
 	if (rc)
 		return rc;
 
-	printk (KERN_INFO RNG_DRIVER_NAME " loaded\n");
+	pr_info(RNG_DRIVER_NAME " loaded\n");
 
 	DPRINTK ("EXIT, returning 0\n");
 	return 0;

             reply	other threads:[~2004-11-16  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16  3:28 james4765 [this message]
2005-01-07  4:00 ` Jeff Garzik

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=20041116032809.17232.34960.53013@localhost.localdomain \
    --to=james4765@verizon.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome