Skip to contentSkip to conversation

fbdev: remove redundant initialization to variable identical

PATCH Applied Colin Ian King 2 participants 2 messages Sep 7, 2022 – Sep 25, 2022

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

PATCH 1/1 fbdev: remove redundant initialization to variable identical

The variable identical is being initialized with a value that is never read. The variable is being re-assigned later on. The initialization is redundant and can be removed.

Cleans up clang scan-build warning:
drivers/video/fbdev/udlfb.c:373:6: warning: Value stored to 'identical' during its initialization is never read [deadcode.DeadStores]

---
 drivers/video/fbdev/udlfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/udlfb.c +1 -1
index c863244ef12c..216d49c9d47e 100644
@@ -370,7 +370,7 @@ static int dlfb_trim_hline(const u8 *bback, const u8 **bfront, int *width_bytes)
 	const unsigned long *back = (const unsigned long *) bback;
 	const unsigned long *front = (const unsigned long *) *bfront;
 	const int width = *width_bytes / sizeof(unsigned long);
-	int identical = width;
+	int identical;
 	int start = width;
 	int end = width;
 
Signature · 1 line
2.37.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Colin Ian King

The variable identical is being initialized with a value that is never read. The variable is being re-assigned later on. The initialization is redundant and can be removed.

Cleans up clang scan-build warning:
drivers/video/fbdev/udlfb.c:373:6: warning: Value stored to 'identical' during its initialization is never read [deadcode.DeadStores]

applied.

Thanks!
Helge

Quoted 17 lines
---
  drivers/video/fbdev/udlfb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/udlfb.c +1 -1
index c863244ef12c..216d49c9d47e 100644
@@ -370,7 +370,7 @@ static int dlfb_trim_hline(const u8 *bback, const u8 **bfront, int *width_bytes)
  	const unsigned long *back = (const unsigned long *) bback;
  	const unsigned long *front = (const unsigned long *) *bfront;
  	const int width = *width_bytes / sizeof(unsigned long);
-	int identical = width;
+	int identical;
  	int start = width;
  	int end = width;