Skip to contentSkip to conversation

drm/radeon: Move assignment outside if condition

PATCH Applied [email protected] 2 participants 2 messages Jul 24, 2023 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 drm/radeon: Move assignment outside if condition

Fixes the following checkpatch errors:

ERROR: do not use assignment in if condition

---
 drivers/gpu/drm/radeon/radeon_legacy_tv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_legacy_tv.c +4 -2
index 12e180b119ac..7883e9ec0bae 100644
@@ -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;
 	}
Applied
#2 lore raw

Applied. Thanks!

Quoted 32 lines · On Sun, Jul 23, 2023 at 11:45 PM <[email protected]> wrote:

Fixes the following checkpatch errors:

ERROR: do not use assignment in if condition

---
  drivers/gpu/drm/radeon/radeon_legacy_tv.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_legacy_tv.c +4 -2
index 12e180b119ac..7883e9ec0bae 100644
@@ -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;
        }