atm: idt77252: Remove redundant error check
Subsystems (4)
PATCH v2 3/4 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.
---
Changes from V1:
- Convert printk(KERN_WARNING ... to pr_warn(...
drivers/atm/idt77252.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/atm/idt77252.c +4 -4
@@ -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);
Signature · 1 line
1.8.3.1
From: Peter Senna Tschudin <[email protected]>
Date: Mon, 19 May 2014 12:26:52 +0200
Quoted 3 lines
Remove double checks, convert printk to
pr_warn, and move the call topr_warnto the first check. The simplified version of the coccinelle semantic patch that find this issue is as follows:
...
Quoted 3 lines
Tested by compilation only.
Signed-off-by Peter Senna Tschudin <[email protected]>
Applied to net-next, thanks.