Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1739801
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/6] [media] tda8261: Adjust three function calls together with a variable assignment |
| Date | 2017-09-26 13:40 +0200 |
| Message-ID | <utWnw-4bR-17@gated-at.bofh.it> (permalink) |
| References | <utWdQ-46A-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Sep 2017 12:52:24 +0200
The script "checkpatch.pl" pointed information out like the following.
ERROR: do not use assignment in if condition
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/dvb-frontends/tda8261.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/dvb-frontends/tda8261.c b/drivers/media/dvb-frontends/tda8261.c
index 492d8c03a5fa..20185ee8f253 100644
--- a/drivers/media/dvb-frontends/tda8261.c
+++ b/drivers/media/dvb-frontends/tda8261.c
@@ -42,7 +42,8 @@ static int tda8261_read(struct tda8261_state *state, u8 *buf)
int err = 0;
struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 1 };
- if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
+ err = i2c_transfer(state->i2c, &msg, 1);
+ if (err != 1)
pr_err("%s: read error, err=%d\n", __func__, err);
return err;
@@ -54,7 +55,8 @@ static int tda8261_write(struct tda8261_state *state, u8 *buf)
int err = 0;
struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 };
- if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
+ err = i2c_transfer(state->i2c, &msg, 1);
+ if (err != 1)
pr_err("%s: write error, err=%d\n", __func__, err);
return err;
@@ -67,8 +69,8 @@ static int tda8261_get_status(struct dvb_frontend *fe, u32 *status)
int err = 0;
*status = 0;
-
- if ((err = tda8261_read(state, &result)) < 0) {
+ err = tda8261_read(state, &result);
+ if (err < 0) {
pr_err("%s: I/O Error\n", __func__);
return err;
}
--
2.14.1
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 0/6] [media] TDA8261: Fine-tuning for five function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:30 +0200
[PATCH 1/6] [media] tda8261: Use common error handling code in tda8261_set_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:30 +0200
Re: [PATCH 1/6] [media] tda8261: Use common error handling code in tda8261_set_params() Christoph Böhmwalder <christoph@boehmwalder.at> - 2017-09-26 13:50 +0200
Re: [PATCH 1/6] [media] tda8261: Use common error handling code in tda8261_set_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 19:00 +0200
[PATCH 2/6] [media] tda8261: Improve a size determination in tda8261_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:30 +0200
[PATCH 6/6] [media] tda8261: Delete an unnecessary variable initialisation in three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:40 +0200
[PATCH 4/6] [media] tda8261: Delete an unnecessary variable initialisation in tda8261_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:40 +0200
[PATCH 3/6] [media] tda8261: Return directly after a failed kzalloc() in tda8261_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:40 +0200
[PATCH 5/6] [media] tda8261: Adjust three function calls together with a variable assignment SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-26 13:40 +0200
csiph-web