Skip to contentSkip to conversation

regulator: fixed: constify regulator_ops structure

PATCH In review Bhumika Goyal 2 participants 2 messages Jan 28, 2017 – Jan 31, 2017 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: fixed: constify regulator_ops structure

Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too.

File size before: drivers/regulator/fixed.o
text data bss dec hex filename
1239 192 0 1431 597 drivers/regulator/fixed.o

File size after: drivers/regulator/fixed.o

   text	   data	    bss	    dec	    hex	filename
  1592      100     128    1820     71c drivers/regulator/fixed.o
---
 drivers/regulator/fixed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/fixed.c +1 -1
index a43b0e8..9619022 100644
@@ -135,7 +135,7 @@ struct fixed_voltage_data {
 	return config;
 }
 
-static struct regulator_ops fixed_voltage_ops = {
+static const struct regulator_ops fixed_voltage_ops = {
 };
 
 static int reg_fixed_voltage_probe(struct platform_device *pdev)
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 3 lines · Bhumika Goyal

Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too.

Sorry, it's *this* change that doens't apply - my mistake.