From: Ivan Bornyakov <brnkv.i1@gmail.com>
To: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: stv090x: fix if-else order
Date: Fri, 27 Jul 2018 14:10:34 +0300 [thread overview]
Message-ID: <20180727111034.f42dhlwijthxfp3n@localhost.localdomain> (raw)
In-Reply-To: <20180726162607.2de43b84@coco.lan>
On Thu, Jul 26, 2018 at 04:26:07PM -0300, Mauro Carvalho Chehab wrote:
> Em Fri, 1 Jun 2018 19:12:21 +0300
> Ivan Bornyakov <brnkv.i1@gmail.com> escreveu:
>
> > 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.
>
> Have you tested it and check at the datasheets if dev_ver > 0x30 makes
> sense?
>
> If not, I would prefer, instead, to remove the dead code, as this
> patch may cause regressions (adding a FIXME comment about this
> special case).
>
Hi, Mauro!
Actually, I did not test it, because I did not have the hardware.
But, in the other places of the code, the same if cases are used.
Here are a couple examples:
static int stv090x_dvbs_track_crl(struct stv090x_state *state)
{
if (state->internal->dev_ver >= 0x30) {
...
} else {
...
}
...
}
static u32 stv090x_srate_srch_coarse(struct stv090x_state *state)
{
...
if (state->internal->dev_ver >= 0x30) {
...
} else if (state->internal->dev_ver >= 0x20) {
...
}
...
}
prev parent reply other threads:[~2018-07-27 11:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 16:12 Ivan Bornyakov
2018-07-26 19:26 ` Mauro Carvalho Chehab
2018-07-27 11:10 ` Ivan Bornyakov [this message]
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=20180727111034.f42dhlwijthxfp3n@localhost.localdomain \
--to=brnkv.i1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+samsung@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®