# \[PATCH\] video: fbdev: s3c-fb: remove redundant initialization of pointer bufs

- Subsystems: FRAMEBUFFER LAYER, SAMSUNG FRAMEBUFFER DRIVER, THE REST
- Maintainers: Helge Deller, Jingoo Han, Linus Torvalds
- Status: LANDED (61cc48163a4f · 2022-01-14 16:58)
- Landed in mainline as 61cc48163a4f on 2022-01-14.
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2021/12/1621231/t

## \[PATCH\] video: fbdev: s3c-fb: remove redundant initialization of pointer bufs

- From: Colin Ian King \<hidden\>
- Date: 2021-12-30 16:06:33 
- Message: https://ratatoskr.run/linux-fbdev/2021/12/1621231.md

```text
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;

Signed-off-by: Colin Ian King <redacted>
---
 drivers/video/fbdev/s3c-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index 3b134e1bbc38..68408c499627 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -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;
-- 
2.33.1

```

## Re: \[PATCH\] video: fbdev: s3c-fb: remove redundant initialization of pointer bufs

- From: Daniel Vetter \<hidden\>
- Date: 2022-01-14 16:59:05 
- Message: https://ratatoskr.run/linux-fbdev/2022/01/1633682.md

```text
On Thu, Dec 30, 2021 at 04:06:26PM +0000, Colin Ian King wrote:
> 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;
> 
> Signed-off-by: Colin Ian King <redacted>

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

> ---
>  drivers/video/fbdev/s3c-fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
> index 3b134e1bbc38..68408c499627 100644
> --- a/drivers/video/fbdev/s3c-fb.c
> +++ b/drivers/video/fbdev/s3c-fb.c
> @@ -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;
> -- 
> 2.33.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
```
