Skip to contentSkip to conversation

drm/amd/display: remove redundant initialization of variable remainder

PATCH Applied Colin Ian King 2 participants 2 messages Dec 19, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: remove redundant initialization of variable remainder

Variable remainder is being initialized with a value that is never read, the assignment is redundant and can be removed. Also add a newline after the declaration to clean up the coding style.

---
 drivers/gpu/drm/amd/display/dc/basics/conversion.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/basics/conversion.c +2 -1
index e295a839ab47..1090d235086a 100644
@@ -103,7 +103,8 @@ void convert_float_matrix(
 
 static uint32_t find_gcd(uint32_t a, uint32_t b)
 {
-	uint32_t remainder = 0;
+	uint32_t remainder;
+
 	while (b != 0) {
 		remainder = a % b;
 		a = b;
Signature · 1 line
2.39.2
Applied
#1 lore raw

Applied. Thanks!

Quoted 27 lines · Colin Ian King

Variable remainder is being initialized with a value that is never read, the assignment is redundant and can be removed. Also add a newline after the declaration to clean up the coding style.

---
 drivers/gpu/drm/amd/display/dc/basics/conversion.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/basics/conversion.c +2 -2
index e295a839ab47..1090d235086a 100644
@@ -103,7 +103,8 @@ void convert_float_matrix(
 
 static uint32_t find_gcd(uint32_t a, uint32_t b)
 {
-       uint32_t remainder = 0;
+       uint32_t remainder;
+
        while (b != 0) {
                remainder = a % b;
                a = b;
--

2.39.2