Commit 653af321 authored by James Nelson's avatar James Nelson Committed by Jeff Garzik

[PATCH] hw_random: Minor cleanup to hw_random.c

Clean up in drivers/char/hw_random.c:
Make debug #defines a little easier to understand.
Small whitespace cleanup.
Change some printk()'s into pr_info()'s.
Add KERN_ constant to debug printk().
Signed-off-by: default avatarJames Nelson <james4765@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 5a33e494
...@@ -56,24 +56,20 @@ ...@@ -56,24 +56,20 @@
/* /*
* debugging macros * debugging macros
*/ */
#undef RNG_DEBUG /* define to enable copious debugging info */
#ifdef RNG_DEBUG /* pr_debug() collapses to a no-op if DEBUG is not defined */
/* note: prints function name for you */ #define DPRINTK(fmt, args...) pr_debug(PFX "%s: " fmt, __FUNCTION__ , ## args)
#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
#else
#define DPRINTK(fmt, args...)
#endif
#define RNG_NDEBUG /* define to disable lightweight runtime checks */
#undef RNG_NDEBUG /* define to enable lightweight runtime checks */
#ifdef RNG_NDEBUG #ifdef RNG_NDEBUG
#define assert(expr)
#else
#define assert(expr) \ #define assert(expr) \
if(!(expr)) { \ if(!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n", \ printk(KERN_DEBUG PFX "Assertion failed! %s,%s,%s," \
#expr,__FILE__,__FUNCTION__,__LINE__); \ "line=%d\n", #expr, __FILE__, __FUNCTION__, __LINE__); \
} }
#else
#define assert(expr)
#endif #endif
#define RNG_MISCDEV_MINOR 183 /* official */ #define RNG_MISCDEV_MINOR 183 /* official */
...@@ -322,7 +318,8 @@ static int __init amd_init (struct pci_dev *dev) ...@@ -322,7 +318,8 @@ static int __init amd_init (struct pci_dev *dev)
rnen |= (1 << 7); /* PMIO enable */ rnen |= (1 << 7); /* PMIO enable */
pci_write_config_byte(dev, 0x41, rnen); 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; amd_dev = dev;
...@@ -606,7 +603,7 @@ static int __init rng_init (void) ...@@ -606,7 +603,7 @@ static int __init rng_init (void)
if (rc) if (rc)
return rc; return rc;
printk (KERN_INFO RNG_DRIVER_NAME " loaded\n"); pr_info( RNG_DRIVER_NAME " loaded\n");
DPRINTK ("EXIT, returning 0\n"); DPRINTK ("EXIT, returning 0\n");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment