From: Alexey Dobriyan Date: Mon, 9 Jan 2006 21:09:16 +0000 (+0300) Subject: [PATCH] Fix more "if ((err = foo() < 0))" typos X-Git-Tag: v2.6.16-rc1~664 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=682e852e2638ed0aff84aa51181c9e5d2f939562;p=linux-2.6 [PATCH] Fix more "if ((err = foo() < 0))" typos Another reason to use: ret = foo(); if (ret < 0) goto out; Signed-off-by: Alexey Dobriyan Signed-off-by: Linus Torvalds --- diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 0541fe1de7..0ea5a0c6e8 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt @@ -411,7 +411,8 @@ int init_module(void) printk("Couldn't find %s to plant kprobe\n", "do_fork"); return -1; } - if ((ret = register_kprobe(&kp) < 0)) { + ret = register_kprobe(&kp); + if (ret < 0) { printk("register_kprobe failed, returned %d\n", ret); return -1; } diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 06be405be3..9c89eebc35 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -1171,7 +1171,8 @@ static int __init vpe_module_init(void) return -ENODEV; } - if ((major = register_chrdev(0, module_name, &vpe_fops) < 0)) { + major = register_chrdev(0, module_name, &vpe_fops); + if (major < 0) { printk("VPE loader: unable to register character device\n"); return major; } diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index 8d672283c9..ec4e641acc 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c @@ -501,7 +501,8 @@ static int mt312_set_frontend(struct dvb_frontend* fe, case ID_VP310: // For now we will do this only for the VP310. // It should be better for the mt312 as well, but tunning will be slower. ACCJr 09/29/03 - if ((ret = mt312_readreg(state, CONFIG, &config_val) < 0)) + ret = mt312_readreg(state, CONFIG, &config_val); + if (ret < 0) return ret; if (p->u.qpsk.symbol_rate >= 30000000) //Note that 30MS/s should use 90MHz {