Skip to contentSkip to conversation

Staging: android: ion: 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: android: ion: 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/android/ion/ion_dummy_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion_dummy_driver.c +1 -1
index b23f2c7..cf5c010 100644
@@ -58,7 +58,7 @@ static struct ion_platform_heap dummy_heaps[] = {
 		},
 };
 
-static struct ion_platform_data dummy_ion_pdata = {
+static const struct ion_platform_data dummy_ion_pdata = {
 	.nr = ARRAY_SIZE(dummy_heaps),
 	.heaps = dummy_heaps,
 };
Signature · 1 line
2.7.4