From: Ivan Bornyakov <brnkv.i1@gmail.com>
To: mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Ivan Bornyakov <brnkv.i1@gmail.com>
Subject: [PATCH] media: stv090x: fix if-else order
Date: Fri, 1 Jun 2018 19:12:21 +0300 [thread overview]
Message-ID: <20180601161221.24807-1-brnkv.i1@gmail.com> (raw)
There is this code:
if (v >= 0x20) {
...
} else if (v < 0x20) {
...
} else if (v > 0x30) {
/* this branch is impossible */
}
It would be sensibly for last branch to be on the top.
Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com>
---
drivers/media/dvb-frontends/stv090x.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c
index 9133f65d4623..d70eb311ebaf 100644
--- a/drivers/media/dvb-frontends/stv090x.c
+++ b/drivers/media/dvb-frontends/stv090x.c
@@ -4841,7 +4841,11 @@ static int stv090x_setup(struct dvb_frontend *fe)
}
state->internal->dev_ver = stv090x_read_reg(state, STV090x_MID);
- if (state->internal->dev_ver >= 0x20) {
+ if (state->internal->dev_ver > 0x30) {
+ /* we shouldn't bail out from here */
+ dprintk(FE_ERROR, 1, "INFO: Cut: 0x%02x probably incomplete support!",
+ state->internal->dev_ver);
+ } else if (state->internal->dev_ver >= 0x20) {
if (stv090x_write_reg(state, STV090x_TSGENERAL, 0x0c) < 0)
goto err;
@@ -4857,10 +4861,6 @@ static int stv090x_setup(struct dvb_frontend *fe)
state->internal->dev_ver);
goto err;
- } else if (state->internal->dev_ver > 0x30) {
- /* we shouldn't bail out from here */
- dprintk(FE_ERROR, 1, "INFO: Cut: 0x%02x probably incomplete support!",
- state->internal->dev_ver);
}
/* ADC1 range */
--
2.16.4
next reply other threads:[~2018-06-01 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 16:12 Ivan Bornyakov [this message]
2018-07-26 19:26 ` Mauro Carvalho Chehab
2018-07-27 11:10 ` Ivan Bornyakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180601161221.24807-1-brnkv.i1@gmail.com \
--to=brnkv.i1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®