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


Groups > linux.kernel > #1568900

[PATCH] regulator: anatop-regulator: constify regulator_ops structure

Path csiph.com!1.us.feeder.erje.net!2.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Bhumika Goyal <bhumirks@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] regulator: anatop-regulator: constify regulator_ops structure
Date Sat, 28 Jan 2017 14:40:01 +0100
Message-ID <t4Bot-23o-7@gated-at.bofh.it> (permalink)
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=IEdZQzKInDY4p7aui/ffOxiWIJiXq1DpdiVSVVeyT5A=; b=qK1SvIoitmc44gO2OycYPdqC7iqtEqe8b9/kqcZdsOksMsp77TOhCV+l3UDJT3DvG2 tOGP7Zwp8zBLELlo3RaYLEM3/2mUmXa/n2K4SMzjEdlK5FApbijBGB0+Pk4rRdyIfK4V stLHQLtR16KfJdABHhuceZJvWytU+bBAlYm3xAbRX0NcMSbiEDLjx1gAku7tvWSxnC9x OXs1Vlg89CCrds/oUAAcKb825iBWnkvShUauDXL38IkJzJT4hbOZswRjcGEq2pjj5AOV /5omXdJz3Y1MKN/++LXUMaDscY/AYUmKJ/LLQU120qalC8Zo3emcixenwgHlAl5DsjNF Dgjg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IEdZQzKInDY4p7aui/ffOxiWIJiXq1DpdiVSVVeyT5A=; b=MaCqWc+xv4SICEr1FnLBzMpUiblVSlEt5og9hIr/iltYdDctkJdLp8i04pgoanRtXJ inETTAi7XrKdV3rQDXVOm2wQcQKCTijdmoSSlckJnCJkevV6ACgDDC2kdS+HCQCNe5QB ZpecpzAvisagPHhZvn0px9Mp5zAQvISBdAi0K3dwdIJJa+q3ti3CcarNSX6MKG5meDHo nKwvqnBrBqqJUU3UoNJlb3D79wM5UXTU9vO+XfGzkOYhCha9NIuKHopVLv724NFm4FvU RU5IhEgSopDhGKwIG+Djua4AbgKnoMjFuJD+eaMcYmEhv8urvnZ0BZyAFWKONz8/pqxE xi2A==
X-Gm-Message-State AIkVDXKHfIZIsO/0qdE+0/2JFy31oKcjql7OFHOS34vOH0LnV7EFlh5CIItc9NJublcvhA==
X-Received by 10.99.123.3 with SMTP id w3mr14692782pgc.155.1485610658967; Sat, 28 Jan 2017 05:37:38 -0800 (PST)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc Bhumika Goyal <bhumirks@gmail.com>
X-Original-Date Sat, 28 Jan 2017 19:07:31 +0530
X-Original-Message-ID <1485610651-29210-1-git-send-email-bhumirks@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1568900

Show key headers only | View raw


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/anatop-regulator.o
   text	   data	    bss	    dec	    hex	filename
   2839	    720	      0	   3559	    de7 regulator/anatop-regulator.o

File size after: drivers/regulator/anatop-regulator.o
   text	   data	    bss	    dec	    hex	filename
   3367	    192	      0	   3559	    de7 regulator/anatop-regulator.o

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

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 3a6d029..330136a 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -157,14 +157,14 @@ static int anatop_regmap_set_bypass(struct regulator_dev *reg, bool enable)
 	return regulator_set_voltage_sel_regmap(reg, sel);
 }
 
-static struct regulator_ops anatop_rops = {
+static const struct regulator_ops anatop_rops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 	.get_voltage_sel = regulator_get_voltage_sel_regmap,
 	.list_voltage = regulator_list_voltage_linear,
 	.map_voltage = regulator_map_voltage_linear,
 };
 
-static struct regulator_ops anatop_core_rops = {
+static const struct regulator_ops anatop_core_rops = {
 	.enable = anatop_regmap_enable,
 	.disable = anatop_regmap_disable,
 	.is_enabled = anatop_regmap_is_enabled,
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] regulator: anatop-regulator: constify regulator_ops structure Bhumika Goyal <bhumirks@gmail.com> - 2017-01-28 14:40 +0100

csiph-web