diff mbox series

[-next,2/3] media: radio-wl1273: Remove an unnecessary ternary operator

Message ID 20230804031323.2105187-3-ruanjinjie@huawei.com
State Superseded
Headers show
Series media: Remove unnecessary ternary operators | expand

Commit Message

Jinjie Ruan Aug. 4, 2023, 3:13 a.m. UTC
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/radio/radio-wl1273.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

J. Neuschäfer Aug. 14, 2023, 8:23 a.m. UTC | #1
On Fri, Aug 04, 2023 at 11:13:22AM +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/radio/radio-wl1273.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
> index e8166eac9efe..f6b98c304b72 100644
> --- a/drivers/media/radio/radio-wl1273.c
> +++ b/drivers/media/radio/radio-wl1273.c
> @@ -1020,7 +1020,7 @@ static int wl1273_fm_set_rds(struct wl1273_device *radio, unsigned int new_mode)
>  	}
>  
>  	if (!r)
> -		radio->rds_on = (new_mode == WL1273_RDS_ON) ? true : false;
> +		radio->rds_on = new_mode == WL1273_RDS_ON;

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

Thanks.
diff mbox series

Patch

diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index e8166eac9efe..f6b98c304b72 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1020,7 +1020,7 @@  static int wl1273_fm_set_rds(struct wl1273_device *radio, unsigned int new_mode)
 	}
 
 	if (!r)
-		radio->rds_on = (new_mode == WL1273_RDS_ON) ? true : false;
+		radio->rds_on = new_mode == WL1273_RDS_ON;
 
 	return r;
 }