kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ds2782_battery: constify ds278x_battery_ops structure
@ 2015-11-13 18:41 Julia Lawall
  2015-12-05  0:41 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-11-13 18:41 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: kernel-janitors, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-pm, linux-kernel

The ds278x_battery_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/power/ds2782_battery.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index ed4d756..a1b7e05 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -59,7 +59,7 @@ struct ds278x_info {
 	struct i2c_client	*client;
 	struct power_supply	*battery;
 	struct power_supply_desc	battery_desc;
-	struct ds278x_battery_ops  *ops;
+	const struct ds278x_battery_ops *ops;
 	struct delayed_work	bat_work;
 	int			id;
 	int                     rsns;
@@ -361,7 +361,7 @@ enum ds278x_num_id {
 	DS2786,
 };
 
-static struct ds278x_battery_ops ds278x_ops[] = {
+static const struct ds278x_battery_ops ds278x_ops[] = {
 	[DS2782] = {
 		.get_battery_current  = ds2782_get_current,
 		.get_battery_voltage  = ds2782_get_voltage,


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ds2782_battery: constify ds278x_battery_ops structure
  2015-11-13 18:41 [PATCH] ds2782_battery: constify ds278x_battery_ops structure Julia Lawall
@ 2015-12-05  0:41 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2015-12-05  0:41 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Dmitry Eremin-Solenikov, David Woodhouse,
	linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

Hi,

On Fri, Nov 13, 2015 at 07:41:34PM +0100, Julia Lawall wrote:
> The ds278x_battery_ops structure is never modified, so declare it as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks, queued.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-05  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 18:41 [PATCH] ds2782_battery: constify ds278x_battery_ops structure Julia Lawall
2015-12-05  0:41 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).