lkml.org 
[lkml]   [2021]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] power: supply: ltc4162-l: Constify static struct attribute_group
Date
The only usage of it is to put its address in an array of pointers to
const static structs. Make it const to allow the compiler to put it in
read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/power/supply/ltc4162-l-charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/ltc4162-l-charger.c b/drivers/power/supply/ltc4162-l-charger.c
index cded6484febb..1a5cb4405ee3 100644
--- a/drivers/power/supply/ltc4162-l-charger.c
+++ b/drivers/power/supply/ltc4162-l-charger.c
@@ -666,7 +666,7 @@ static struct attribute *ltc4162l_sysfs_entries[] = {
NULL,
};

-static struct attribute_group ltc4162l_attr_group = {
+static const struct attribute_group ltc4162l_attr_group = {
.name = NULL, /* put in device directory */
.attrs = ltc4162l_sysfs_entries,
};
--
2.30.0
\
 
 \ /
  Last update: 2021-01-13 21:35    [W:0.101 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site