From: Jeff Garzik <jgarzik@pobox.com>
To: james4765@verizon.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hw_random: Update printk()'s in hw_random.c
Date: Sat, 06 Nov 2004 12:13:07 -0500 [thread overview]
Message-ID: <418D0623.8000302@pobox.com> (raw)
In-Reply-To: <20041105211912.17210.55119.84600@localhost.localdomain>
james4765@verizon.net wrote:
> Update drivers/char/hw_random.c to pr_debug()/pr_info()
>
> 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-05 15:26:10.869606837 -0500
> @@ -56,31 +56,28 @@
> /*
> * debugging macros
> */
> -#undef RNG_DEBUG /* define to enable copious debugging info */
> +#undef DEBUG /* define to enable copious debugging info */
I think the '#undef DEBUG' line is supposed to precede all the
#includes, yes?
> +/* pr_debug() collapses to a no-op if DEBUG is not defined */
> +#define DPRINTK(fmt, args...) pr_debug(PFX "%s: " fmt, __FUNCTION__ , ## args)
>
> -#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
>
> -#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);
seemingly bogus whitespace change
> 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;
>
> @@ -413,7 +410,8 @@
> * completes.
> */
> via_rng_datum = 0; /* paranoia, not really necessary */
> - bytes_out = xstore(&via_rng_datum, VIA_RNG_CHUNK_1) & VIA_XSTORE_CNT_MASK;
> + bytes_out = xstore(&via_rng_datum, VIA_RNG_CHUNK_1) &
> + VIA_XSTORE_CNT_MASK;
bogus whitespace change
next prev parent reply other threads:[~2004-11-06 17:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-05 21:19 [PATCH] hw_random: Update printk()'s in hw_random.c james4765
2004-11-05 21:19 ` [PATCH] hw_random: Remove changelog from hw_random.txt james4765
2004-11-06 17:46 ` Jeff Garzik
2004-11-06 17:13 ` Jeff Garzik [this message]
2004-11-06 18:27 ` [PATCH] hw_random: Update printk()'s in hw_random.c Jim Nelson
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=418D0623.8000302@pobox.com \
--to=jgarzik@pobox.com \
--cc=james4765@verizon.net \
--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