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

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 <rikard.falkeborn@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414171251.14672-5-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rikard Falkeborn and committed by
Greg Kroah-Hartman
d9962f6f a525ed17

+4 -4
+1 -1
drivers/hwtracing/intel_th/intel_th.h
··· 178 178 /* file_operations for those who want a device node */ 179 179 const struct file_operations *fops; 180 180 /* optional attributes */ 181 - struct attribute_group *attr_group; 181 + const struct attribute_group *attr_group; 182 182 183 183 /* source ops */ 184 184 int (*set_output)(struct intel_th_device *thdev,
+1 -1
drivers/hwtracing/intel_th/msu.c
··· 2095 2095 NULL, 2096 2096 }; 2097 2097 2098 - static struct attribute_group msc_output_group = { 2098 + static const struct attribute_group msc_output_group = { 2099 2099 .attrs = msc_output_attrs, 2100 2100 }; 2101 2101
+2 -2
drivers/hwtracing/intel_th/pti.c
··· 142 142 NULL, 143 143 }; 144 144 145 - static struct attribute_group pti_output_group = { 145 + static const struct attribute_group pti_output_group = { 146 146 .attrs = pti_output_attrs, 147 147 }; 148 148 ··· 295 295 NULL, 296 296 }; 297 297 298 - static struct attribute_group lpp_output_group = { 298 + static const struct attribute_group lpp_output_group = { 299 299 .attrs = lpp_output_attrs, 300 300 }; 301 301