All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power-supply: Constify static psy_tzd_ops struct
@ 2021-01-20  9:54 Jian Dong
  2021-01-20 19:16 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jian Dong @ 2021-01-20  9:54 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, dongjian, huyue2, zhangwen

From: dongjian <dongjian@yulong.com>

The usage of this struct is to assign operation function's address
to the field in thermal_zone_device_ops, it is a const pointer.
make it const to allow the compiler to put it in read-only memory.

Signed-off-by: dongjian <dongjian@yulong.com>
---
 drivers/power/supply/power_supply_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 38e3aa64..ae34856 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -952,7 +952,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops psy_tzd_ops = {
+static const struct thermal_zone_device_ops psy_tzd_ops = {
 	.get_temp = power_supply_read_temp,
 };
 
-- 
1.9.1



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

end of thread, other threads:[~2021-01-28  0:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20  9:54 [PATCH] power-supply: Constify static psy_tzd_ops struct Jian Dong
2021-01-20 19:16 ` kernel test robot
2021-01-20 21:50 ` kernel test robot
2021-01-20 21:50   ` kernel test robot
2021-01-28  0:30 ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.