All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: <mchehab@kernel.org>, <hverkuil-cisco@xs4all.nl>,
	<j.neuschaefer@gmx.net>, <linux-media@vger.kernel.org>
Subject: Re: [PATCH -next 1/3] media: dvb-frontends: drx39xyj: Remove an unnecessary ternary operator
Date: Fri, 4 Aug 2023 14:18:10 +0800	[thread overview]
Message-ID: <dc418511-5a9c-6fa6-2768-d626faedb8d8@huawei.com> (raw)
In-Reply-To: <20230804060500.mxnjbvwemucudpd5@pengutronix.de>



On 2023/8/4 14:05, Uwe Kleine-König wrote:
> On Fri, Aug 04, 2023 at 11:13:21AM +0800, Ruan Jinjie wrote:
>> There is a ternary operator, the true or false judgement of which
>> is unnecessary in C language semantics.
>>
>> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
>> ---
>>  drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
>> index 68f4e8b5a0ab..e54e61c3518a 100644
>> --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
>> +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
>> @@ -4779,7 +4779,7 @@ set_frequency(struct drx_demod_instance *demod,
>>  	bool image_to_select;
>>  	s32 fm_frequency_shift = 0;
>>  
>> -	rf_mirror = (ext_attr->mirror == DRX_MIRROR_YES) ? true : false;
>> +	rf_mirror = ext_attr->mirror == DRX_MIRROR_YES;
>>  	tuner_mirror = demod->my_common_attr->mirror_freq_spect ? false : true;
> 
> Maybe also do:
> 
> -	tuner_mirror = demod->my_common_attr->mirror_freq_spect ? false : true;
> +	tuner_mirror = !demod->my_common_attr->mirror_freq_spect;
> 
> ?

Right!

> 
> Best regards
> Uwe
> 
>>  	/*
>>  	   Program frequency shifter
> 

  reply	other threads:[~2023-08-04  6:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  3:13 [PATCH -next 0/3] media: Remove unnecessary ternary operators Ruan Jinjie
2023-08-04  3:13 ` [PATCH -next 1/3] media: dvb-frontends: drx39xyj: Remove an unnecessary ternary operator Ruan Jinjie
2023-08-04  6:05   ` Uwe Kleine-König
2023-08-04  6:18     ` Ruan Jinjie [this message]
2023-08-04  3:13 ` [PATCH -next 2/3] media: radio-wl1273: " Ruan Jinjie
2023-08-14  8:23   ` Jonathan Neuschäfer
2023-08-04  3:13 ` [PATCH -next 3/3] media: dvb-usb: gp8psk: " Ruan Jinjie

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=dc418511-5a9c-6fa6-2768-d626faedb8d8@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=j.neuschaefer@gmx.net \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.