2022-10-10 08:24:39

by Yang Li

[permalink] [raw]
Subject: [PATCH -next] drm/amd/display: Simplify bool conversion

The result of 'pwr_status == 0' is Boolean, and the question mark
expression is redundant.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2354
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index 955ca273cfe1..cbda458bf040 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
break;
}

- return pwr_status == 0 ? true : false;
+ return pwr_status == 0;
}

void dcn32_update_dsc_pg(struct dc *dc,
--
2.20.1.7.g153144c


2022-10-11 16:24:03

by Harry Wentland

[permalink] [raw]
Subject: Re: [PATCH -next] drm/amd/display: Simplify bool conversion

On 2022-10-10 03:38, Yang Li wrote:
> The result of 'pwr_status == 0' is Boolean, and the question mark
> expression is redundant.
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2354
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Yang Li <[email protected]>

Reviewed-by: Harry Wentland <[email protected]>

Harry

> ---
> drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> index 955ca273cfe1..cbda458bf040 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> @@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
> break;
> }
>
> - return pwr_status == 0 ? true : false;
> + return pwr_status == 0;
> }
>
> void dcn32_update_dsc_pg(struct dc *dc,

2022-10-11 16:28:24

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH -next] drm/amd/display: Simplify bool conversion

Applied. Thanks!

Alex

On Tue, Oct 11, 2022 at 11:27 AM Harry Wentland <[email protected]> wrote:
>
> On 2022-10-10 03:38, Yang Li wrote:
> > The result of 'pwr_status == 0' is Boolean, and the question mark
> > expression is redundant.
> >
> > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2354
> > Reported-by: Abaci Robot <[email protected]>
> > Signed-off-by: Yang Li <[email protected]>
>
> Reviewed-by: Harry Wentland <[email protected]>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> > index 955ca273cfe1..cbda458bf040 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
> > @@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
> > break;
> > }
> >
> > - return pwr_status == 0 ? true : false;
> > + return pwr_status == 0;
> > }
> >
> > void dcn32_update_dsc_pg(struct dc *dc,
>