2024-01-11 06:40:35

by XueBing Chen

[permalink] [raw]
Subject: [PATCH] drm/edid: Clean up errors in drm_edid.h

Fix the following errors reported by checkpatch:

ERROR: do not use assignment in if condition

Signed-off-by: chenxuebing <[email protected]>
---
drivers/gpu/drm/drm_edid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 69c68804023f..9bcaf76f10fc 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3611,7 +3611,8 @@ static bool mode_in_range(const struct drm_display_mode *mode,
if (!mode_in_vsync_range(mode, edid, t))
return false;

- if ((max_clock = range_pixel_clock(edid, t)))
+ max_clock = range_pixel_clock(edid, t);
+ if (max_clock)
if (mode->clock > max_clock)
return false;

--
2.17.1



2024-01-11 10:02:18

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH] drm/edid: Clean up errors in drm_edid.h

On Thu, 11 Jan 2024, chenxuebing <[email protected]> wrote:
> Fix the following errors reported by checkpatch:
>
> ERROR: do not use assignment in if condition
>
> Signed-off-by: chenxuebing <[email protected]>

Reviewed-by: Jani Nikula <[email protected]>

> ---
> drivers/gpu/drm/drm_edid.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 69c68804023f..9bcaf76f10fc 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3611,7 +3611,8 @@ static bool mode_in_range(const struct drm_display_mode *mode,
> if (!mode_in_vsync_range(mode, edid, t))
> return false;
>
> - if ((max_clock = range_pixel_clock(edid, t)))
> + max_clock = range_pixel_clock(edid, t);
> + if (max_clock)
> if (mode->clock > max_clock)
> return false;

--
Jani Nikula, Intel

2024-01-11 14:50:57

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH] drm/edid: Clean up errors in drm_edid.h

On Thu, 11 Jan 2024, Jani Nikula <[email protected]> wrote:
> On Thu, 11 Jan 2024, chenxuebing <[email protected]> wrote:
>> Fix the following errors reported by checkpatch:
>>
>> ERROR: do not use assignment in if condition
>>
>> Signed-off-by: chenxuebing <[email protected]>
>
> Reviewed-by: Jani Nikula <[email protected]>

And pushed to drm-misc-next, thanks for the patch.

BR,
Jani.

>
>> ---
>> drivers/gpu/drm/drm_edid.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 69c68804023f..9bcaf76f10fc 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3611,7 +3611,8 @@ static bool mode_in_range(const struct drm_display_mode *mode,
>> if (!mode_in_vsync_range(mode, edid, t))
>> return false;
>>
>> - if ((max_clock = range_pixel_clock(edid, t)))
>> + max_clock = range_pixel_clock(edid, t);
>> + if (max_clock)
>> if (mode->clock > max_clock)
>> return false;

--
Jani Nikula, Intel