Skip to contentSkip to conversation

video: fbdev: udlfb: Remove redundant initialization of

PATCH New Yang Li 1 participant 1 message May 12, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 video: fbdev: udlfb: Remove redundant initialization of

Integer variable 'identical' is being initialized however this value is never read as 'identical' is assigned the result of 'start + (width - end)'. Remove the redundant assignment. At the same time, adjust the declarations order of variables to keep the "upside-down x-mas tree" look of them.

Clean up clang warning:

drivers/video/fbdev/udlfb.c:370:6: warning: Value stored to 'identical' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

---
 drivers/video/fbdev/udlfb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/udlfb.c +3 -3
index b9cdd02..f40dd6d8 100644
@@ -363,13 +363,13 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
  */
 static int dlfb_trim_hline(const u8 *bback, const u8 **bfront, int *width_bytes)
 {
-	int j, k;
-	const unsigned long *back = (const unsigned long *) bback;
 	const unsigned long *front = (const unsigned long *) *bfront;
+	const unsigned long *back = (const unsigned long *) bback;
 	const int width = *width_bytes / sizeof(unsigned long);
-	int identical = width;
 	int start = width;
 	int end = width;
+	int identical;
+	int j, k;
 
 	for (j = 0; j < width; j++) {
 		if (back[j] != front[j]) {
Signature · 1 line
1.8.3.1