Skip to content

Commit 3b9a22d

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
drivers: perf: arm_pmuv3: Drop some unused arguments from armv8_pmu_init()
All the PMU init functions want the default sysfs attribute groups, and so these all call armv8_pmu_init_nogroups() helper, with none of them calling armv8_pmu_init() directly. When we introduced armv8_pmu_init_nogroups() in the commit e424b17 ("arm64: perf: Refactor PMU init callbacks") ... we thought that we might need custom attribute groups in future, but as we evidently haven't, we can remove the option. This patch folds armv8_pmu_init_nogroups() into armv8_pmu_init(), removing the ability to use custom attribute groups and simplifying the code. CC: James Clark <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Mark Rutland <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 58f8fc5 commit 3b9a22d

File tree

1 file changed

+12
-32
lines changed

1 file changed

+12
-32
lines changed

drivers/perf/arm_pmuv3.c

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,7 @@ static void armv8_pmu_register_sysctl_table(void)
11871187
}
11881188

11891189
static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name,
1190-
int (*map_event)(struct perf_event *event),
1191-
const struct attribute_group *events,
1192-
const struct attribute_group *format,
1193-
const struct attribute_group *caps)
1190+
int (*map_event)(struct perf_event *event))
11941191
{
11951192
int ret = armv8pmu_probe_pmu(cpu_pmu);
11961193
if (ret)
@@ -1212,27 +1209,17 @@ static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name,
12121209

12131210
cpu_pmu->name = name;
12141211
cpu_pmu->map_event = map_event;
1215-
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = events ?
1216-
events : &armv8_pmuv3_events_attr_group;
1217-
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = format ?
1218-
format : &armv8_pmuv3_format_attr_group;
1219-
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_CAPS] = caps ?
1220-
caps : &armv8_pmuv3_caps_attr_group;
1221-
1212+
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = &armv8_pmuv3_events_attr_group;
1213+
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = &armv8_pmuv3_format_attr_group;
1214+
cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_CAPS] = &armv8_pmuv3_caps_attr_group;
12221215
armv8_pmu_register_sysctl_table();
12231216
return 0;
12241217
}
12251218

1226-
static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name,
1227-
int (*map_event)(struct perf_event *event))
1228-
{
1229-
return armv8_pmu_init(cpu_pmu, name, map_event, NULL, NULL, NULL);
1230-
}
1231-
12321219
#define PMUV3_INIT_SIMPLE(name) \
12331220
static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
12341221
{ \
1235-
return armv8_pmu_init_nogroups(cpu_pmu, #name, armv8_pmuv3_map_event);\
1222+
return armv8_pmu_init(cpu_pmu, #name, armv8_pmuv3_map_event); \
12361223
}
12371224

12381225
PMUV3_INIT_SIMPLE(armv8_pmuv3)
@@ -1263,44 +1250,37 @@ PMUV3_INIT_SIMPLE(armv8_nvidia_denver)
12631250

12641251
static int armv8_a35_pmu_init(struct arm_pmu *cpu_pmu)
12651252
{
1266-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a35",
1267-
armv8_a53_map_event);
1253+
return armv8_pmu_init(cpu_pmu, "armv8_cortex_a35", armv8_a53_map_event);
12681254
}
12691255

12701256
static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu)
12711257
{
1272-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a53",
1273-
armv8_a53_map_event);
1258+
return armv8_pmu_init(cpu_pmu, "armv8_cortex_a53", armv8_a53_map_event);
12741259
}
12751260

12761261
static int armv8_a57_pmu_init(struct arm_pmu *cpu_pmu)
12771262
{
1278-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a57",
1279-
armv8_a57_map_event);
1263+
return armv8_pmu_init(cpu_pmu, "armv8_cortex_a57", armv8_a57_map_event);
12801264
}
12811265

12821266
static int armv8_a72_pmu_init(struct arm_pmu *cpu_pmu)
12831267
{
1284-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a72",
1285-
armv8_a57_map_event);
1268+
return armv8_pmu_init(cpu_pmu, "armv8_cortex_a72", armv8_a57_map_event);
12861269
}
12871270

12881271
static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu)
12891272
{
1290-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a73",
1291-
armv8_a73_map_event);
1273+
return armv8_pmu_init(cpu_pmu, "armv8_cortex_a73", armv8_a73_map_event);
12921274
}
12931275

12941276
static int armv8_thunder_pmu_init(struct arm_pmu *cpu_pmu)
12951277
{
1296-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cavium_thunder",
1297-
armv8_thunder_map_event);
1278+
return armv8_pmu_init(cpu_pmu, "armv8_cavium_thunder", armv8_thunder_map_event);
12981279
}
12991280

13001281
static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
13011282
{
1302-
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_brcm_vulcan",
1303-
armv8_vulcan_map_event);
1283+
return armv8_pmu_init(cpu_pmu, "armv8_brcm_vulcan", armv8_vulcan_map_event);
13041284
}
13051285

13061286
static const struct of_device_id armv8_pmu_of_device_ids[] = {

0 commit comments

Comments
 (0)