# \[PATCH\] udlfb: Make dlfb\_ops constant

- Subsystems: DISPLAYLINK USB 2.0 FRAMEBUFFER DRIVER (UDLFB), FRAMEBUFFER LAYER, THE REST
- Maintainers: Bernie Thompson, Helge Deller, Linus Torvalds
- Status: LANDED (df5eff6d2a44 · 2019-08-19 13:52)
- Landed in mainline as df5eff6d2a44 on 2019-08-19.
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2019/08/9167284/t

## \[PATCH\] udlfb: Make dlfb\_ops constant

- From: Nishka Dasgupta \<hidden\>
- Date: 2019-08-19 07:52:48 
- Message: https://ratatoskr.run/linux-fbdev/2019/08/9167284.md

```text
Static structure dlfb_ops, of type fb_ops, is not used except to be
copied into another variable. Hence make dlfb_ops constant to protect it
from unintended modification.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <redacted>
---
 drivers/video/fbdev/udlfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index c328e8265cb1..fe373b63ddd6 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1183,7 +1183,7 @@ static int dlfb_ops_blank(int blank_mode, struct fb_info *info)
 	return 0;
 }
 
-static struct fb_ops dlfb_ops = {
+static const struct fb_ops dlfb_ops = {
 	.owner = THIS_MODULE,
 	.fb_read = fb_sys_read,
 	.fb_write = dlfb_ops_write,
-- 
2.19.1
```

## Re: \[PATCH\] udlfb: Make dlfb\_ops constant

- From: Bartlomiej Zolnierkiewicz \<hidden\>
- Date: 2019-08-19 14:10:39 
- Message: https://ratatoskr.run/linux-fbdev/2019/08/9167297.md

```text

On 8/19/19 9:52 AM, Nishka Dasgupta wrote:
> Static structure dlfb_ops, of type fb_ops, is not used except to be
> copied into another variable. Hence make dlfb_ops constant to protect it
> from unintended modification.
> Issue found with Coccinelle.
> 
> Signed-off-by: Nishka Dasgupta <redacted>
Patch queued for v5.4, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
```
