2021-06-16 20:19:46

by Jiabing Wan

[permalink] [raw]
Subject: [PATCH] drm/display: Fix duplicated argument

Fix coccicheck warning:

./drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c:
55:12-42: duplicated argument to && or ||

Signed-off-by: Wan Jiabing <[email protected]>
---
.../gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
index cb15525ddb49..dc8b3afef301 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
@@ -52,7 +52,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
*BytePerPixelDETC = 0;
*BytePerPixelY = 4;
*BytePerPixelC = 0;
- } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
+ } else if (SourcePixelFormat == dm_444_16) {
*BytePerPixelDETY = 2;
*BytePerPixelDETC = 0;
*BytePerPixelY = 2;
--
2.30.2


2021-06-18 13:58:22

by Harry Wentland

[permalink] [raw]
Subject: Re: [PATCH] drm/display: Fix duplicated argument

On 2021-06-16 10:40 a.m., Wan Jiabing wrote:
> Fix coccicheck warning:
>
> ./drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c:
> 55:12-42: duplicated argument to && or ||
>
> Signed-off-by: Wan Jiabing <[email protected]>

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

Harry

> ---
> .../gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> index cb15525ddb49..dc8b3afef301 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> @@ -52,7 +52,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
> *BytePerPixelDETC = 0;
> *BytePerPixelY = 4;
> *BytePerPixelC = 0;
> - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
> + } else if (SourcePixelFormat == dm_444_16) {
> *BytePerPixelDETY = 2;
> *BytePerPixelDETC = 0;
> *BytePerPixelY = 2;
>

2021-06-19 03:52:27

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] drm/display: Fix duplicated argument

Applied. Thanks!

On Fri, Jun 18, 2021 at 9:56 AM Harry Wentland <[email protected]> wrote:
>
> On 2021-06-16 10:40 a.m., Wan Jiabing wrote:
> > Fix coccicheck warning:
> >
> > ./drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c:
> > 55:12-42: duplicated argument to && or ||
> >
> > Signed-off-by: Wan Jiabing <[email protected]>
>
> Reviewed-by: Harry Wentland <[email protected]>
>
> Harry
>
> > ---
> > .../gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> > index cb15525ddb49..dc8b3afef301 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> > @@ -52,7 +52,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
> > *BytePerPixelDETC = 0;
> > *BytePerPixelY = 4;
> > *BytePerPixelC = 0;
> > - } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
> > + } else if (SourcePixelFormat == dm_444_16) {
> > *BytePerPixelDETY = 2;
> > *BytePerPixelDETC = 0;
> > *BytePerPixelY = 2;
> >
>