Skip to contentSkip to conversation

video: fbdev: s3c-fb: remove redundant initialization of pointer bufs

PATCH In review Colin Ian King 2 participants 2 messages Dec 30, 2021 – Jan 14, 2022

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

PATCH 1/1 video: fbdev: s3c-fb: remove redundant initialization of pointer bufs

Pointer bufs is being initialized with a value that is never read, it is being re-assigned with a different value later on. The assignment is redundant and can be removed. Cleans up clang-scan warning:

drivers/video/fbdev/s3c-fb.c:492:16: warning: Value stored to 'buf' during its initialization is never read [deadcode.DeadStores]

        void __iomem *buf = regs;
---
 drivers/video/fbdev/s3c-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/s3c-fb.c +1 -1
index 3b134e1bbc38..68408c499627 100644
@@ -489,7 +489,7 @@ static int s3c_fb_set_par(struct fb_info *info)
 	struct s3c_fb_win *win = info->par;
 	struct s3c_fb *sfb = win->parent;
 	void __iomem *regs = sfb->regs;
-	void __iomem *buf = regs;
+	void __iomem *buf;
 	int win_no = win->index;
 	u32 alpha = 0;
 	u32 data;
Signature · 1 line
2.33.1
#1 lore raw
Quoted 9 lines · Colin Ian King

Pointer bufs is being initialized with a value that is never read, it is being re-assigned with a different value later on. The assignment is redundant and can be removed. Cleans up clang-scan warning:

drivers/video/fbdev/s3c-fb.c:492:16: warning: Value stored to 'buf' during its initialization is never read [deadcode.DeadStores]

        void __iomem *buf = regs;

Both of your dead store fixes queued up in drm-misc-next for 5.18. -Daniel

Quoted 20 lines
---
 drivers/video/fbdev/s3c-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/s3c-fb.c +1 -1
index 3b134e1bbc38..68408c499627 100644
@@ -489,7 +489,7 @@ static int s3c_fb_set_par(struct fb_info *info)
 	struct s3c_fb_win *win = info->par;
 	struct s3c_fb *sfb = win->parent;
 	void __iomem *regs = sfb->regs;
-	void __iomem *buf = regs;
+	void __iomem *buf;
 	int win_no = win->index;
 	u32 alpha = 0;
 	u32 data;
Signature · 1 line
2.33.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch