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

Configure Feed

Select the types of activity you want to include in your feed.

intel_th: Constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
intel_th_source_device_type, intel_th_output_device_type,
intel_th_switch_device_type and intel_th_device_type variables to be
constant structures as well, placing it into read-only memory which can not
be modified at runtime.

Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
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/20240429130119.1518073-7-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricardo B. Marliere and committed by
Greg Kroah-Hartman
8dc0b2d3 1592e84c

+4 -4
+4 -4
drivers/hwtracing/intel_th/core.c
··· 180 180 intel_th_device_free(to_intel_th_device(dev)); 181 181 } 182 182 183 - static struct device_type intel_th_source_device_type = { 183 + static const struct device_type intel_th_source_device_type = { 184 184 .name = "intel_th_source_device", 185 185 .release = intel_th_device_release, 186 186 }; ··· 333 333 334 334 ATTRIBUTE_GROUPS(intel_th_output); 335 335 336 - static struct device_type intel_th_output_device_type = { 336 + static const struct device_type intel_th_output_device_type = { 337 337 .name = "intel_th_output_device", 338 338 .groups = intel_th_output_groups, 339 339 .release = intel_th_device_release, 340 340 .devnode = intel_th_output_devnode, 341 341 }; 342 342 343 - static struct device_type intel_th_switch_device_type = { 343 + static const struct device_type intel_th_switch_device_type = { 344 344 .name = "intel_th_switch_device", 345 345 .release = intel_th_device_release, 346 346 }; 347 347 348 - static struct device_type *intel_th_device_type[] = { 348 + static const struct device_type *intel_th_device_type[] = { 349 349 [INTEL_TH_SOURCE] = &intel_th_source_device_type, 350 350 [INTEL_TH_OUTPUT] = &intel_th_output_device_type, 351 351 [INTEL_TH_SWITCH] = &intel_th_switch_device_type,