Skip to content

Commit 682e852

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
[PATCH] Fix more "if ((err = foo() < 0))" typos
Another reason to use: ret = foo(); if (ret < 0) goto out; Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 41ed16f commit 682e852

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Documentation/kprobes.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ int init_module(void)
411411
printk("Couldn't find %s to plant kprobe\n", "do_fork");
412412
return -1;
413413
}
414-
if ((ret = register_kprobe(&kp) < 0)) {
414+
ret = register_kprobe(&kp);
415+
if (ret < 0) {
415416
printk("register_kprobe failed, returned %d\n", ret);
416417
return -1;
417418
}

arch/mips/kernel/vpe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,8 @@ static int __init vpe_module_init(void)
11711171
return -ENODEV;
11721172
}
11731173

1174-
if ((major = register_chrdev(0, module_name, &vpe_fops) < 0)) {
1174+
major = register_chrdev(0, module_name, &vpe_fops);
1175+
if (major < 0) {
11751176
printk("VPE loader: unable to register character device\n");
11761177
return major;
11771178
}

drivers/media/dvb/frontends/mt312.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,8 @@ static int mt312_set_frontend(struct dvb_frontend* fe,
501501
case ID_VP310:
502502
// For now we will do this only for the VP310.
503503
// It should be better for the mt312 as well, but tunning will be slower. ACCJr 09/29/03
504-
if ((ret = mt312_readreg(state, CONFIG, &config_val) < 0))
504+
ret = mt312_readreg(state, CONFIG, &config_val);
505+
if (ret < 0)
505506
return ret;
506507
if (p->u.qpsk.symbol_rate >= 30000000) //Note that 30MS/s should use 90MHz
507508
{

0 commit comments

Comments
 (0)