Skip to content

Commit 8dc0b2d

Browse files
rbmarlieregregkh
authored andcommitted
intel_th: Constify the struct device_type usage
Since commit aed65af ("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>
1 parent 1592e84 commit 8dc0b2d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • drivers/hwtracing/intel_th

drivers/hwtracing/intel_th/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void intel_th_device_release(struct device *dev)
180180
intel_th_device_free(to_intel_th_device(dev));
181181
}
182182

183-
static struct device_type intel_th_source_device_type = {
183+
static const struct device_type intel_th_source_device_type = {
184184
.name = "intel_th_source_device",
185185
.release = intel_th_device_release,
186186
};
@@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] = {
333333

334334
ATTRIBUTE_GROUPS(intel_th_output);
335335

336-
static struct device_type intel_th_output_device_type = {
336+
static const struct device_type intel_th_output_device_type = {
337337
.name = "intel_th_output_device",
338338
.groups = intel_th_output_groups,
339339
.release = intel_th_device_release,
340340
.devnode = intel_th_output_devnode,
341341
};
342342

343-
static struct device_type intel_th_switch_device_type = {
343+
static const struct device_type intel_th_switch_device_type = {
344344
.name = "intel_th_switch_device",
345345
.release = intel_th_device_release,
346346
};
347347

348-
static struct device_type *intel_th_device_type[] = {
348+
static const struct device_type *intel_th_device_type[] = {
349349
[INTEL_TH_SOURCE] = &intel_th_source_device_type,
350350
[INTEL_TH_OUTPUT] = &intel_th_output_device_type,
351351
[INTEL_TH_SWITCH] = &intel_th_switch_device_type,

0 commit comments

Comments
 (0)