Skip to contentSkip to conversation

Staging: board: Make a read-only structure

PATCH New Mihaela Muraru 1 participant 1 message Oct 17, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: board: Make a read-only structure

This patch add const qualifier at the declaration of the structure. The structure become a read-only data, this increase the security.

Found with Coccinelle:
@r disable optional_qualifier@
identifier s,i;
@@
* static struct s i ={...};

---
 drivers/staging/board/armadillo800eva.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/board/armadillo800eva.c +1 -1
index 4de4fd0..fbf0fae 100644
@@ -27,7 +27,7 @@
 
 #include "board.h"
 
-static struct fb_videomode lcdc0_mode = {
+static const struct fb_videomode lcdc0_mode = {
 	.name		= "AMPIER/AM-800480",
 	.xres		= 800,
 	.yres		= 480,
Signature · 1 line
2.7.4