Skip to content

Commit 45bd07a

Browse files
ArvindYadavCsKAGA-KOKO
authored andcommitted
x86: Constify attribute_group structures
attribute_groups are not supposed to change at runtime and none of the groups is modified. Mark the non-const structs as const. [ tglx: Folded into one big patch ] Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected]
1 parent 187e91f commit 45bd07a

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static struct attribute *uncore_pmu_attrs[] = {
721721
NULL,
722722
};
723723

724-
static struct attribute_group uncore_pmu_attr_group = {
724+
static const struct attribute_group uncore_pmu_attr_group = {
725725
.attrs = uncore_pmu_attrs,
726726
};
727727

arch/x86/events/intel/uncore_nhmex.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static struct attribute *nhmex_uncore_ubox_formats_attr[] = {
272272
NULL,
273273
};
274274

275-
static struct attribute_group nhmex_uncore_ubox_format_group = {
275+
static const struct attribute_group nhmex_uncore_ubox_format_group = {
276276
.name = "format",
277277
.attrs = nhmex_uncore_ubox_formats_attr,
278278
};
@@ -299,7 +299,7 @@ static struct attribute *nhmex_uncore_cbox_formats_attr[] = {
299299
NULL,
300300
};
301301

302-
static struct attribute_group nhmex_uncore_cbox_format_group = {
302+
static const struct attribute_group nhmex_uncore_cbox_format_group = {
303303
.name = "format",
304304
.attrs = nhmex_uncore_cbox_formats_attr,
305305
};
@@ -407,7 +407,7 @@ static struct attribute *nhmex_uncore_bbox_formats_attr[] = {
407407
NULL,
408408
};
409409

410-
static struct attribute_group nhmex_uncore_bbox_format_group = {
410+
static const struct attribute_group nhmex_uncore_bbox_format_group = {
411411
.name = "format",
412412
.attrs = nhmex_uncore_bbox_formats_attr,
413413
};
@@ -484,7 +484,7 @@ static struct attribute *nhmex_uncore_sbox_formats_attr[] = {
484484
NULL,
485485
};
486486

487-
static struct attribute_group nhmex_uncore_sbox_format_group = {
487+
static const struct attribute_group nhmex_uncore_sbox_format_group = {
488488
.name = "format",
489489
.attrs = nhmex_uncore_sbox_formats_attr,
490490
};
@@ -898,7 +898,7 @@ static struct attribute *nhmex_uncore_mbox_formats_attr[] = {
898898
NULL,
899899
};
900900

901-
static struct attribute_group nhmex_uncore_mbox_format_group = {
901+
static const struct attribute_group nhmex_uncore_mbox_format_group = {
902902
.name = "format",
903903
.attrs = nhmex_uncore_mbox_formats_attr,
904904
};
@@ -1163,7 +1163,7 @@ static struct attribute *nhmex_uncore_rbox_formats_attr[] = {
11631163
NULL,
11641164
};
11651165

1166-
static struct attribute_group nhmex_uncore_rbox_format_group = {
1166+
static const struct attribute_group nhmex_uncore_rbox_format_group = {
11671167
.name = "format",
11681168
.attrs = nhmex_uncore_rbox_formats_attr,
11691169
};

arch/x86/events/intel/uncore_snb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static struct attribute *snb_uncore_formats_attr[] = {
130130
NULL,
131131
};
132132

133-
static struct attribute_group snb_uncore_format_group = {
133+
static const struct attribute_group snb_uncore_format_group = {
134134
.name = "format",
135135
.attrs = snb_uncore_formats_attr,
136136
};
@@ -289,7 +289,7 @@ static struct attribute *snb_uncore_imc_formats_attr[] = {
289289
NULL,
290290
};
291291

292-
static struct attribute_group snb_uncore_imc_format_group = {
292+
static const struct attribute_group snb_uncore_imc_format_group = {
293293
.name = "format",
294294
.attrs = snb_uncore_imc_formats_attr,
295295
};
@@ -769,7 +769,7 @@ static struct attribute *nhm_uncore_formats_attr[] = {
769769
NULL,
770770
};
771771

772-
static struct attribute_group nhm_uncore_format_group = {
772+
static const struct attribute_group nhm_uncore_format_group = {
773773
.name = "format",
774774
.attrs = nhm_uncore_formats_attr,
775775
};

arch/x86/events/intel/uncore_snbep.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -602,27 +602,27 @@ static struct uncore_event_desc snbep_uncore_qpi_events[] = {
602602
{ /* end: all zeroes */ },
603603
};
604604

605-
static struct attribute_group snbep_uncore_format_group = {
605+
static const struct attribute_group snbep_uncore_format_group = {
606606
.name = "format",
607607
.attrs = snbep_uncore_formats_attr,
608608
};
609609

610-
static struct attribute_group snbep_uncore_ubox_format_group = {
610+
static const struct attribute_group snbep_uncore_ubox_format_group = {
611611
.name = "format",
612612
.attrs = snbep_uncore_ubox_formats_attr,
613613
};
614614

615-
static struct attribute_group snbep_uncore_cbox_format_group = {
615+
static const struct attribute_group snbep_uncore_cbox_format_group = {
616616
.name = "format",
617617
.attrs = snbep_uncore_cbox_formats_attr,
618618
};
619619

620-
static struct attribute_group snbep_uncore_pcu_format_group = {
620+
static const struct attribute_group snbep_uncore_pcu_format_group = {
621621
.name = "format",
622622
.attrs = snbep_uncore_pcu_formats_attr,
623623
};
624624

625-
static struct attribute_group snbep_uncore_qpi_format_group = {
625+
static const struct attribute_group snbep_uncore_qpi_format_group = {
626626
.name = "format",
627627
.attrs = snbep_uncore_qpi_formats_attr,
628628
};
@@ -1431,27 +1431,27 @@ static struct attribute *ivbep_uncore_qpi_formats_attr[] = {
14311431
NULL,
14321432
};
14331433

1434-
static struct attribute_group ivbep_uncore_format_group = {
1434+
static const struct attribute_group ivbep_uncore_format_group = {
14351435
.name = "format",
14361436
.attrs = ivbep_uncore_formats_attr,
14371437
};
14381438

1439-
static struct attribute_group ivbep_uncore_ubox_format_group = {
1439+
static const struct attribute_group ivbep_uncore_ubox_format_group = {
14401440
.name = "format",
14411441
.attrs = ivbep_uncore_ubox_formats_attr,
14421442
};
14431443

1444-
static struct attribute_group ivbep_uncore_cbox_format_group = {
1444+
static const struct attribute_group ivbep_uncore_cbox_format_group = {
14451445
.name = "format",
14461446
.attrs = ivbep_uncore_cbox_formats_attr,
14471447
};
14481448

1449-
static struct attribute_group ivbep_uncore_pcu_format_group = {
1449+
static const struct attribute_group ivbep_uncore_pcu_format_group = {
14501450
.name = "format",
14511451
.attrs = ivbep_uncore_pcu_formats_attr,
14521452
};
14531453

1454-
static struct attribute_group ivbep_uncore_qpi_format_group = {
1454+
static const struct attribute_group ivbep_uncore_qpi_format_group = {
14551455
.name = "format",
14561456
.attrs = ivbep_uncore_qpi_formats_attr,
14571457
};
@@ -1887,7 +1887,7 @@ static struct attribute *knl_uncore_ubox_formats_attr[] = {
18871887
NULL,
18881888
};
18891889

1890-
static struct attribute_group knl_uncore_ubox_format_group = {
1890+
static const struct attribute_group knl_uncore_ubox_format_group = {
18911891
.name = "format",
18921892
.attrs = knl_uncore_ubox_formats_attr,
18931893
};
@@ -1927,7 +1927,7 @@ static struct attribute *knl_uncore_cha_formats_attr[] = {
19271927
NULL,
19281928
};
19291929

1930-
static struct attribute_group knl_uncore_cha_format_group = {
1930+
static const struct attribute_group knl_uncore_cha_format_group = {
19311931
.name = "format",
19321932
.attrs = knl_uncore_cha_formats_attr,
19331933
};
@@ -2037,7 +2037,7 @@ static struct attribute *knl_uncore_pcu_formats_attr[] = {
20372037
NULL,
20382038
};
20392039

2040-
static struct attribute_group knl_uncore_pcu_format_group = {
2040+
static const struct attribute_group knl_uncore_pcu_format_group = {
20412041
.name = "format",
20422042
.attrs = knl_uncore_pcu_formats_attr,
20432043
};
@@ -2187,7 +2187,7 @@ static struct attribute *knl_uncore_irp_formats_attr[] = {
21872187
NULL,
21882188
};
21892189

2190-
static struct attribute_group knl_uncore_irp_format_group = {
2190+
static const struct attribute_group knl_uncore_irp_format_group = {
21912191
.name = "format",
21922192
.attrs = knl_uncore_irp_formats_attr,
21932193
};
@@ -2385,7 +2385,7 @@ static struct attribute *hswep_uncore_ubox_formats_attr[] = {
23852385
NULL,
23862386
};
23872387

2388-
static struct attribute_group hswep_uncore_ubox_format_group = {
2388+
static const struct attribute_group hswep_uncore_ubox_format_group = {
23892389
.name = "format",
23902390
.attrs = hswep_uncore_ubox_formats_attr,
23912391
};
@@ -2439,7 +2439,7 @@ static struct attribute *hswep_uncore_cbox_formats_attr[] = {
24392439
NULL,
24402440
};
24412441

2442-
static struct attribute_group hswep_uncore_cbox_format_group = {
2442+
static const struct attribute_group hswep_uncore_cbox_format_group = {
24432443
.name = "format",
24442444
.attrs = hswep_uncore_cbox_formats_attr,
24452445
};
@@ -2621,7 +2621,7 @@ static struct attribute *hswep_uncore_sbox_formats_attr[] = {
26212621
NULL,
26222622
};
26232623

2624-
static struct attribute_group hswep_uncore_sbox_format_group = {
2624+
static const struct attribute_group hswep_uncore_sbox_format_group = {
26252625
.name = "format",
26262626
.attrs = hswep_uncore_sbox_formats_attr,
26272627
};
@@ -3314,7 +3314,7 @@ static struct attribute *skx_uncore_cha_formats_attr[] = {
33143314
NULL,
33153315
};
33163316

3317-
static struct attribute_group skx_uncore_chabox_format_group = {
3317+
static const struct attribute_group skx_uncore_chabox_format_group = {
33183318
.name = "format",
33193319
.attrs = skx_uncore_cha_formats_attr,
33203320
};
@@ -3427,7 +3427,7 @@ static struct attribute *skx_uncore_iio_formats_attr[] = {
34273427
NULL,
34283428
};
34293429

3430-
static struct attribute_group skx_uncore_iio_format_group = {
3430+
static const struct attribute_group skx_uncore_iio_format_group = {
34313431
.name = "format",
34323432
.attrs = skx_uncore_iio_formats_attr,
34333433
};
@@ -3484,7 +3484,7 @@ static struct attribute *skx_uncore_formats_attr[] = {
34843484
NULL,
34853485
};
34863486

3487-
static struct attribute_group skx_uncore_format_group = {
3487+
static const struct attribute_group skx_uncore_format_group = {
34883488
.name = "format",
34893489
.attrs = skx_uncore_formats_attr,
34903490
};
@@ -3605,7 +3605,7 @@ static struct attribute *skx_upi_uncore_formats_attr[] = {
36053605
NULL,
36063606
};
36073607

3608-
static struct attribute_group skx_upi_uncore_format_group = {
3608+
static const struct attribute_group skx_upi_uncore_format_group = {
36093609
.name = "format",
36103610
.attrs = skx_upi_uncore_formats_attr,
36113611
};

arch/x86/kernel/cpu/mcheck/therm_throt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static struct attribute *thermal_throttle_attrs[] = {
122122
NULL
123123
};
124124

125-
static struct attribute_group thermal_attr_group = {
125+
static const struct attribute_group thermal_attr_group = {
126126
.attrs = thermal_throttle_attrs,
127127
.name = "thermal_throttle"
128128
};

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ static struct attribute *mc_default_attrs[] = {
561561
NULL
562562
};
563563

564-
static struct attribute_group mc_attr_group = {
564+
static const struct attribute_group mc_attr_group = {
565565
.attrs = mc_default_attrs,
566566
.name = "microcode",
567567
};
@@ -707,7 +707,7 @@ static struct attribute *cpu_root_microcode_attrs[] = {
707707
NULL
708708
};
709709

710-
static struct attribute_group cpu_root_microcode_group = {
710+
static const struct attribute_group cpu_root_microcode_group = {
711711
.name = "microcode",
712712
.attrs = cpu_root_microcode_attrs,
713713
};

arch/x86/kernel/ksysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static struct bin_attribute *boot_params_data_attrs[] = {
5555
NULL,
5656
};
5757

58-
static struct attribute_group boot_params_attr_group = {
58+
static const struct attribute_group boot_params_attr_group = {
5959
.attrs = boot_params_version_attrs,
6060
.bin_attrs = boot_params_data_attrs,
6161
};
@@ -202,7 +202,7 @@ static struct bin_attribute *setup_data_data_attrs[] = {
202202
NULL,
203203
};
204204

205-
static struct attribute_group setup_data_attr_group = {
205+
static const struct attribute_group setup_data_attr_group = {
206206
.attrs = setup_data_type_attrs,
207207
.bin_attrs = setup_data_data_attrs,
208208
};

0 commit comments

Comments
 (0)