Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1568927 > unrolled thread

[PATCH] regulator: ltc3589: constify regulator_ops structure

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-01-28 15:20 +0100
Last post2017-01-28 15:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] regulator: ltc3589: constify regulator_ops structure Bhumika Goyal <bhumirks@gmail.com> - 2017-01-28 15:20 +0100

#1568927 — [PATCH] regulator: ltc3589: constify regulator_ops structure

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-01-28 15:20 +0100
Subject[PATCH] regulator: ltc3589: constify regulator_ops structure
Message-ID<t4C1b-2wu-13@gated-at.bofh.it>
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/ltc3589.o
   text	   data	    bss	    dec	    hex	filename
   2564	   3312	    288	   6164	   1814	drivers/regulator/ltc3589.o

File size after: drivers/regulator/ltc3589.o
   text	   data	    bss	    dec	    hex	filename
   3604	   2544	      8	   6156	   180c	drivers/regulator/ltc3589.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/regulator/ltc3589.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c
index 47bef32..a7a1a03 100644
--- a/drivers/regulator/ltc3589.c
+++ b/drivers/regulator/ltc3589.c
@@ -161,7 +161,7 @@ static int ltc3589_set_suspend_mode(struct regulator_dev *rdev,
 }
 
 /* SW1, SW2, SW3, LDO2 */
-static struct regulator_ops ltc3589_linear_regulator_ops = {
+static const struct regulator_ops ltc3589_linear_regulator_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
@@ -175,18 +175,18 @@ static int ltc3589_set_suspend_mode(struct regulator_dev *rdev,
 };
 
 /* BB_OUT, LDO3 */
-static struct regulator_ops ltc3589_fixed_regulator_ops = {
+static const struct regulator_ops ltc3589_fixed_regulator_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
 };
 
 /* LDO1 */
-static struct regulator_ops ltc3589_fixed_standby_regulator_ops = {
+static const struct regulator_ops ltc3589_fixed_standby_regulator_ops = {
 };
 
 /* LDO4 */
-static struct regulator_ops ltc3589_table_regulator_ops = {
+static const struct regulator_ops ltc3589_table_regulator_ops = {
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web