Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: ds2782_battery: constify ds278x_battery_ops structure

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>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Julia Lawall and committed by
Sebastian Reichel
79fbdb66 b7e16ec6

+2 -2
+2 -2
drivers/power/ds2782_battery.c
··· 59 59 struct i2c_client *client; 60 60 struct power_supply *battery; 61 61 struct power_supply_desc battery_desc; 62 - struct ds278x_battery_ops *ops; 62 + const struct ds278x_battery_ops *ops; 63 63 struct delayed_work bat_work; 64 64 int id; 65 65 int rsns; ··· 361 361 DS2786, 362 362 }; 363 363 364 - static struct ds278x_battery_ops ds278x_ops[] = { 364 + static const struct ds278x_battery_ops ds278x_ops[] = { 365 365 [DS2782] = { 366 366 .get_battery_current = ds2782_get_current, 367 367 .get_battery_voltage = ds2782_get_voltage,