OSDN Git Service

drm/radeon: Move assignment outside if condition
authorRan Sun <sunran001@208suo.com>
Mon, 24 Jul 2023 03:44:56 +0000 (11:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jul 2023 18:47:34 +0000 (14:47 -0400)
Fixes the following checkpatch errors:

ERROR: do not use assignment in if condition

Signed-off-by: Ran Sun <sunran001@208suo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_legacy_tv.c

index 12e180b..7883e9e 100644 (file)
@@ -724,12 +724,14 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
        }
 
        for (i = 0; i < MAX_H_CODE_TIMING_LEN; i++) {
-               if ((tv_dac->tv.h_code_timing[i] = hor_timing[i]) == 0)
+               tv_dac->tv.h_code_timing[i] = hor_timing[i];
+               if (tv_dac->tv.h_code_timing[i] == 0)
                        break;
        }
 
        for (i = 0; i < MAX_V_CODE_TIMING_LEN; i++) {
-               if ((tv_dac->tv.v_code_timing[i] = vert_timing[i]) == 0)
+               tv_dac->tv.v_code_timing[i] = vert_timing[i];
+               if (tv_dac->tv.v_code_timing[i] == 0)
                        break;
        }