* [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c
@ 2020-04-27 6:37 Jason Yan
2020-04-27 7:18 ` Joe Perches
2020-04-27 8:03 ` Christian König
0 siblings, 2 replies; 4+ messages in thread
From: Jason Yan @ 2020-04-27 6:37 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
David1.Zhou, airlied, daniel, amd-gfx, dri-devel, linux-kernel
Cc: Jason Yan
The '==' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING:
conversion to bool not needed here
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
index de9c857ab3e9..9d7432f3fb16 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
@@ -452,7 +452,7 @@ void mpc2_set_output_gamma(
next_mode = LUT_RAM_A;
mpc20_power_on_ogam_lut(mpc, mpcc_id, true);
- mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A ? true:false);
+ mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A);
if (next_mode == LUT_RAM_A)
mpc2_program_luta(mpc, mpcc_id, params);
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c
2020-04-27 6:37 [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c Jason Yan
@ 2020-04-27 7:18 ` Joe Perches
2020-04-27 8:03 ` Christian König
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-04-27 7:18 UTC (permalink / raw)
To: Jason Yan, harry.wentland, sunpeng.li, alexander.deucher,
christian.koenig, David1.Zhou, airlied, daniel, amd-gfx,
dri-devel, linux-kernel
On Mon, 2020-04-27 at 14:37 +0800, Jason Yan wrote:
> The '==' expression itself is bool, no need to convert it to bool again.
trivia:
These descriptions are not quite correct.
The operators return an int, either 0 or 1.
-----------------
6.5.8 Relational operators
6 Each of the operators < (less than), > (greater than), <= (less than or equal to), and >=
(greater than or equal to) shall yield 1 if the specified relation is true and 0 if it is false. 90)
The result has type int
6.5.9 Equality operators
3 The == (equal to) and != (not equal to) operators are analogous to the relational
operators except for their lower precedence. 91) Each of the operators yields 1 if the
specified relation is true and 0 if it is false. The result has type int. For any pair of
operands, exactly one of the relations is true.
-----------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c
2020-04-27 6:37 [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c Jason Yan
2020-04-27 7:18 ` Joe Perches
@ 2020-04-27 8:03 ` Christian König
2020-04-27 19:32 ` Alex Deucher
1 sibling, 1 reply; 4+ messages in thread
From: Christian König @ 2020-04-27 8:03 UTC (permalink / raw)
To: Jason Yan, harry.wentland, sunpeng.li, alexander.deucher,
David1.Zhou, airlied, daniel, amd-gfx, dri-devel, linux-kernel
Am 27.04.20 um 08:37 schrieb Jason Yan:
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
>
> drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING:
> conversion to bool not needed here
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> index de9c857ab3e9..9d7432f3fb16 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> @@ -452,7 +452,7 @@ void mpc2_set_output_gamma(
> next_mode = LUT_RAM_A;
>
> mpc20_power_on_ogam_lut(mpc, mpcc_id, true);
> - mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A ? true:false);
> + mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A);
>
> if (next_mode == LUT_RAM_A)
> mpc2_program_luta(mpc, mpcc_id, params);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c
2020-04-27 8:03 ` Christian König
@ 2020-04-27 19:32 ` Alex Deucher
0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2020-04-27 19:32 UTC (permalink / raw)
To: Christian König
Cc: Jason Yan, Wentland, Harry, Leo (Sunpeng) Li, Deucher, Alexander,
Chunming Zhou, Dave Airlie, Daniel Vetter, amd-gfx list,
Maling list - DRI developers, LKML
Applied. Thanks!
Alex
On Mon, Apr 27, 2020 at 4:03 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 27.04.20 um 08:37 schrieb Jason Yan:
> > The '==' expression itself is bool, no need to convert it to bool again.
> > This fixes the following coccicheck warning:
> >
> > drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c:455:70-75: WARNING:
> > conversion to bool not needed here
> >
> > Signed-off-by: Jason Yan <yanaijie@huawei.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> > ---
> > drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > index de9c857ab3e9..9d7432f3fb16 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> > @@ -452,7 +452,7 @@ void mpc2_set_output_gamma(
> > next_mode = LUT_RAM_A;
> >
> > mpc20_power_on_ogam_lut(mpc, mpcc_id, true);
> > - mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A ? true:false);
> > + mpc20_configure_ogam_lut(mpc, mpcc_id, next_mode == LUT_RAM_A);
> >
> > if (next_mode == LUT_RAM_A)
> > mpc2_program_luta(mpc, mpcc_id, params);
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-27 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 6:37 [PATCH] drm/amd/display: remove conversion to bool in dcn20_mpc.c Jason Yan
2020-04-27 7:18 ` Joe Perches
2020-04-27 8:03 ` Christian König
2020-04-27 19:32 ` Alex Deucher
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).