diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-05-19 12:26:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-21 15:56:26 -0400 |
commit | 7e910357f620bbebe5c5cb038b70d408e624522f (patch) | |
tree | 06b29b84139ee10d2c4ed1a43e46b501fc439036 /drivers/atm | |
parent | 14956643550f2d2748ab08b7cbdbb3342bc942c4 (diff) | |
download | lwn-7e910357f620bbebe5c5cb038b70d408e624522f.tar.gz lwn-7e910357f620bbebe5c5cb038b70d408e624522f.zip |
atm: idt77252: Remove redundant error check
Remove double checks, convert printk to pr_warn, and move the call to
pr_warn to the first check. The simplified version of the coccinelle
semantic patch that find this issue is as follows:
// <smpl>
@@
expression E; identifier pr; expression list es;
@@
while(...){
...
- if (E) break;
+ if (E){
+ pr(es);
+ break;
+ }
...
}
- if(E) pr(es);
// </smpl>
Tested by compilation only.
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/idt77252.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 1bdf104e90bb..b621f56a36be 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -2551,12 +2551,12 @@ done: timeout = 5 * 1000; while (atomic_read(&vc->scq->used) > 0) { timeout = msleep_interruptible(timeout); - if (!timeout) + if (!timeout) { + pr_warn("%s: SCQ drain timeout: %u used\n", + card->name, atomic_read(&vc->scq->used)); break; + } } - if (!timeout) - printk("%s: SCQ drain timeout: %u used\n", - card->name, atomic_read(&vc->scq->used)); writel(TCMDQ_HALT | vc->index, SAR_REG_TCMDQ); clear_scd(card, vc->scq, vc->class); |