Skip to contentSkip to conversation

dell-rbtn: constify rfkill_ops structures

PATCH In review Bhumika Goyal 2 participants 2 messages Jun 9, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dell-rbtn: constify rfkill_ops structures

Add const to rfkill_ops structures that are only passed as an argument to the functions rfkill_alloc or samsung_new_rfkill. These arguments are of type const, so such structures can be annotated with const.

---
Changes since v1:
* Split the changes to one patch per vendor.

 drivers/platform/x86/dell-rbtn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/dell-rbtn.c +1 -1
index dcd9f40..6b5bbaf 100644
@@ -110,7 +110,7 @@ static int rbtn_rfkill_set_block(void *data, bool blocked)
 	return -EINVAL;
 }
 
-static struct rfkill_ops rbtn_ops = {
+static const struct rfkill_ops rbtn_ops = {
 	.query = rbtn_rfkill_query,
 	.set_block = rbtn_rfkill_set_block,
 };
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Bhumika Goyal

Add const to rfkill_ops structures that are only passed as an argument to the functions rfkill_alloc or samsung_new_rfkill. These arguments are of type const, so such structures can be annotated with const.

All three pushed to testing, thanks

Quoted 24 lines

---
Changes since v1:
* Split the changes to one patch per vendor.

 drivers/platform/x86/dell-rbtn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/dell-rbtn.c +1 -2
index dcd9f40..6b5bbaf 100644
@@ -110,7 +110,7 @@ static int rbtn_rfkill_set_block(void *data, bool blocked)
        return -EINVAL;
 }
 
-static struct rfkill_ops rbtn_ops = {
+static const struct rfkill_ops rbtn_ops = {
        .query = rbtn_rfkill_query,
        .set_block = rbtn_rfkill_set_block,
 };
--

2.7.4

Signature · 2 lines
With Best Regards,
Andy Shevchenko