intel_th: Constify attribute_group structs
Subsystems (2)
PATCH 1/1 intel_th: Constify attribute_group structs
The only usage of them is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which have pointers to const attribute_group structs as input. Make them const to allow the compiler to put them in read-only memory.
Signed-off-by Rikard Falkeborn <[email protected]>
--- drivers/hwtracing/intel_th/intel_th.h | 2 +- drivers/hwtracing/intel_th/msu.c | 2 +- drivers/hwtracing/intel_th/pti.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/hwtracing/intel_th/intel_th.h +1 -1
@@ -178,7 +178,7 @@ struct intel_th_driver {/* file_operations for those who want a device node */ const struct file_operations *fops;/* optional attributes */ -struct attribute_group *attr_group; +const struct attribute_group *attr_group;/* source ops */ int (*set_output)(struct intel_th_device *thdev,
drivers/hwtracing/intel_th/msu.c +1 -1
@@ -2095,7 +2095,7 @@ static struct attribute *msc_output_attrs[] = { NULL, }; -static struct attribute_group msc_output_group = { +static const struct attribute_group msc_output_group = { .attrs = msc_output_attrs, };
drivers/hwtracing/intel_th/pti.c +2 -2
@@ -142,7 +142,7 @@ static struct attribute *pti_output_attrs[] = { NULL, }; -static struct attribute_group pti_output_group = { +static const struct attribute_group pti_output_group = { .attrs = pti_output_attrs, };
@@ -295,7 +295,7 @@ static struct attribute *lpp_output_attrs[] = { NULL, }; -static struct attribute_group lpp_output_group = { +static const struct attribute_group lpp_output_group = { .attrs = lpp_output_attrs, };
Signature · 1 line
2.30.0