From: Hans Verkuil <hverkuil@xs4all.nl>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>,
linux-kernel@vger.kernel.org
Cc: skhan@linuxfoundation.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org
Subject: Re: [PATCH 14/20] media: dvb-frontends: lgdt3306a.c: remove dead code
Date: Wed, 19 Aug 2020 15:35:30 +0200 [thread overview]
Message-ID: <378b3a76-1d14-8c69-f9be-3749e6c3c083@xs4all.nl> (raw)
In-Reply-To: <20200807083548.204360-14-dwlsalmeida@gmail.com>
On 07/08/2020 10:35, Daniel W. S. Almeida wrote:
> From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
>
> Fix the following coccinelle report:
>
> drivers/media/dvb-frontends/lgdt3306a.c:718:5-8:
> Unneeded variable: "ret". Return "0" on line 744
>
> Code was enclosed with #if 0 and thus this variable was not needed.
> Remove that code altogether.
>
> Found using - Coccinelle (http://coccinelle.lip6.fr)
>
> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
> ---
> drivers/media/dvb-frontends/lgdt3306a.c | 27 +------------------------
> 1 file changed, 1 insertion(+), 26 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c
> index d3c330e035c4..0247ef799546 100644
> --- a/drivers/media/dvb-frontends/lgdt3306a.c
> +++ b/drivers/media/dvb-frontends/lgdt3306a.c
> @@ -715,33 +715,8 @@ static int lgdt3306a_spectral_inversion(struct lgdt3306a_state *state,
> struct dtv_frontend_properties *p,
> int inversion)
> {
> - int ret = 0;
> -
> dbg_info("(%d)\n", inversion);
> -#if 0
> - /*
> - * FGR - spectral_inversion defaults already set for VSB and QAM;
> - * can enable later if desired
> - */
> -
> - ret = lgdt3306a_set_inversion(state, inversion);
> -
> - switch (p->modulation) {
> - case VSB_8:
> - /* Manual only for VSB */
> - ret = lgdt3306a_set_inversion_auto(state, 0);
> - break;
> - case QAM_64:
> - case QAM_256:
> - case QAM_AUTO:
> - /* Auto ok for QAM */
> - ret = lgdt3306a_set_inversion_auto(state, 1);
> - break;
> - default:
> - ret = -EINVAL;
> - }
> -#endif
> - return ret;
> + return 0;
> }
>
> static int lgdt3306a_set_if(struct lgdt3306a_state *state,
>
You can drop the lgdt3306a_spectral_inversion function completely
since the function doesn't do anything. It would be good to replace
the function call with the comment "spectral_inversion defaults already
set for VSB and QAM" so that information isn't lost.
Regards,
Hans
prev parent reply other threads:[~2020-08-19 13:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 8:35 [PATCH 14/20] media: dvb-frontends: lgdt3306a.c: remove dead code Daniel W. S. Almeida
2020-08-19 13:35 ` Hans Verkuil [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=378b3a76-1d14-8c69-f9be-3749e6c3c083@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=dwlsalmeida@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=skhan@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).