public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][resend] hw_random: Update printk()'s in hw_random.c
@ 2004-11-06 18:36 james4765
  0 siblings, 0 replies; 3+ messages in thread
From: james4765 @ 2004-11-06 18:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: jgarzik, james4765

diff -urN --exclude='*~' linux-2.6.9-original/drivers/char/hw_random.c linux-2.6.9/drivers/char/hw_random.c
--- linux-2.6.9-original/drivers/char/hw_random.c	2004-10-18 17:53:50.000000000 -0400
+++ linux-2.6.9/drivers/char/hw_random.c	2004-11-06 13:30:17.682633097 -0500
@@ -21,6 +21,7 @@
 
  */
 
+#undef DEBUG /* define to enable copious debugging info */
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -56,31 +57,27 @@
 /*
  * 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
+/* pr_debug() collapses to a no-op if DEBUG is not defined */
+#define DPRINTK(fmt, args...) pr_debug(PFX "%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 */
 
 static int rng_dev_open (struct inode *inode, struct file *filp);
 static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
-			     loff_t * offp);
+                 loff_t * offp);
 
 static int __init intel_init (struct pci_dev *dev);
 static void intel_cleanup(void);
@@ -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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH][resend] hw_random: Update printk()'s in hw_random.c
@ 2004-11-06 18:42 Jim Nelson
  2004-11-15  0:20 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Nelson @ 2004-11-06 18:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: jgarzik

Whoops - forgot the header for this patch.

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

diff -urN --exclude='*~' linux-2.6.9-original/drivers/char/hw_random.c 
linux-2.6.9/drivers/char/hw_random.c
--- linux-2.6.9-original/drivers/char/hw_random.c	2004-10-18 17:53:50.000000000 -0400
+++ linux-2.6.9/drivers/char/hw_random.c	2004-11-06 13:30:17.682633097 -0500
@@ -21,6 +21,7 @@

   */

+#undef DEBUG /* define to enable copious debugging info */

  #include <linux/module.h>
  #include <linux/kernel.h>
@@ -56,31 +57,27 @@
  /*
   * 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
+/* pr_debug() collapses to a no-op if DEBUG is not defined */
+#define DPRINTK(fmt, args...) pr_debug(PFX "%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 */

  static int rng_dev_open (struct inode *inode, struct file *filp);
  static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
-			     loff_t * offp);
+                 loff_t * offp);

  static int __init intel_init (struct pci_dev *dev);
  static void intel_cleanup(void);
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][resend] hw_random: Update printk()'s in hw_random.c
  2004-11-06 18:42 [PATCH][resend] hw_random: Update printk()'s in hw_random.c Jim Nelson
@ 2004-11-15  0:20 ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2004-11-15  0:20 UTC (permalink / raw)
  To: Jim Nelson; +Cc: linux-kernel

patch is OK, but doesn't seem to apply to current hw_random.c...

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-15  0:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-06 18:42 [PATCH][resend] hw_random: Update printk()'s in hw_random.c Jim Nelson
2004-11-15  0:20 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-11-06 18:36 james4765

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox