public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org
Subject: [2.6 patch] drivers/char/hw_random.c: remove assert()'s
Date: Thu, 13 Apr 2006 13:57:42 +0200	[thread overview]
Message-ID: <20060413115742.GA8171@stusta.de> (raw)

This patch removes the assert()'s from drivers/char/hw_random.c since
you both needed to enable a manual option in the driver source to make 
them effective and they only covered some obviously impossible cases.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/char/hw_random.c |   21 ---------------------
 1 file changed, 21 deletions(-)

--- linux-2.6.17-rc1-mm2-full/drivers/char/hw_random.c.old	2006-04-13 10:37:15.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/hw_random.c	2006-04-13 10:37:39.000000000 +0200
@@ -66,17 +66,6 @@
 #define DPRINTK(fmt, args...) pr_debug(PFX "%s: " fmt, __FUNCTION__ , ## args)
 
 
-#undef RNG_NDEBUG        /* define to enable lightweight runtime checks */
-#ifdef RNG_NDEBUG
-#define assert(expr)							\
-		if(!(expr)) {						\
-		printk(KERN_DEBUG PFX "Assertion failed! %s,%s,%s,"	\
-		"line=%d\n", #expr, __FILE__, __FUNCTION__, __LINE__);	\
-		}
-#else
-#define assert(expr)
-#endif
-
 #define RNG_MISCDEV_MINOR		183 /* official */
 
 static int rng_dev_open (struct inode *inode, struct file *filp);
@@ -211,29 +200,23 @@
 
 static inline u8 intel_hwstatus (void)
 {
-	assert (rng_mem != NULL);
 	return readb (rng_mem + INTEL_RNG_HW_STATUS);
 }
 
 static inline u8 intel_hwstatus_set (u8 hw_status)
 {
-	assert (rng_mem != NULL);
 	writeb (hw_status, rng_mem + INTEL_RNG_HW_STATUS);
 	return intel_hwstatus ();
 }
 
 static unsigned int intel_data_present(void)
 {
-	assert (rng_mem != NULL);
-
 	return (readb (rng_mem + INTEL_RNG_STATUS) & INTEL_RNG_DATA_PRESENT) ?
 		1 : 0;
 }
 
 static u32 intel_data_read(void)
 {
-	assert (rng_mem != NULL);
-
 	return readb (rng_mem + INTEL_RNG_DATA);
 }
 
@@ -495,7 +478,6 @@
 {
 	u32 val;
 
-	assert(geode_rng_base != NULL);
 	val = readl(geode_rng_base + GEODE_RNG_DATA_REG);
 	return val;
 }
@@ -504,7 +486,6 @@
 {
 	u32 val;
 
-	assert(geode_rng_base != NULL);
 	val = readl(geode_rng_base + GEODE_RNG_STATUS_REG);
 	return val;
 }
@@ -605,8 +586,6 @@
 
 	DPRINTK ("ENTER\n");
 
-	assert(rng_ops != NULL);
-
 	rc = rng_ops->init(dev);
 	if (rc)
 		goto err_out;


             reply	other threads:[~2006-04-13 11:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-13 11:57 Adrian Bunk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-05-01  7:11 [2.6 patch] drivers/char/hw_random.c: remove assert()'s Adrian Bunk

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=20060413115742.GA8171@stusta.de \
    --to=bunk@stusta.de \
    --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