Skip to contentSkip to conversation

Staging: comedi: drivers: 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: comedi: drivers: 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/comedi/drivers/addi_apci_3501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/addi_apci_3501.c +1 -1
index 57f0f46..1fdc0f8 100644
@@ -94,7 +94,7 @@ struct apci3501_private {
 	unsigned char timer_mode;
 };
 
-static struct comedi_lrange apci3501_ao_range = {
+static const struct comedi_lrange apci3501_ao_range = {
 	2, {
 		BIP_RANGE(10),
 		UNI_RANGE(10)
Signature · 1 line
2.7.4