Skip to content

Commit d5b7350

Browse files
Alexander AntonovPeter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Make set_mapping() procedure void
Return value of set_mapping() is not needed to be checked anymore. So, make this procedure void. Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Link: https://lore.kernel.org/r/20221117122833.3103580-12-alexander.antonov@linux.intel.com
1 parent 61fb0f7 commit d5b7350

2 files changed

Lines changed: 20 additions & 23 deletions

File tree

arch/x86/events/intel/uncore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct intel_uncore_type {
9494
* Optional callbacks for managing mapping of Uncore units to PMONs
9595
*/
9696
int (*get_topology)(struct intel_uncore_type *type);
97-
int (*set_mapping)(struct intel_uncore_type *type);
97+
void (*set_mapping)(struct intel_uncore_type *type);
9898
void (*cleanup_mapping)(struct intel_uncore_type *type);
9999
};
100100

arch/x86/events/intel/uncore_snbep.c

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3924,7 +3924,7 @@ static void pmu_clear_mapping_attr(const struct attribute_group **groups,
39243924
}
39253925
}
39263926

3927-
static int
3927+
static void
39283928
pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
39293929
ssize_t (*show)(struct device*, struct device_attribute*, char*),
39303930
int topology_type)
@@ -3943,8 +3943,6 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
39433943
if (ret < 0)
39443944
goto clear_topology;
39453945

3946-
ret = -ENOMEM;
3947-
39483946
/* One more for NULL. */
39493947
attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL);
39503948
if (!attrs)
@@ -3968,7 +3966,7 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
39683966
}
39693967
ag->attrs = attrs;
39703968

3971-
return 0;
3969+
return;
39723970
err:
39733971
for (; die >= 0; die--)
39743972
kfree(eas[die].attr.attr.name);
@@ -3979,7 +3977,6 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
39793977
pmu_free_topology(type);
39803978
clear_attr_update:
39813979
pmu_clear_mapping_attr(type->attr_update, ag);
3982-
return ret;
39833980
}
39843981

39853982
static void
@@ -3998,15 +3995,15 @@ pmu_cleanup_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
39983995
pmu_free_topology(type);
39993996
}
40003997

4001-
static int
3998+
static void
40023999
pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
40034000
{
4004-
return pmu_set_mapping(type, ag, skx_iio_mapping_show, IIO_TOPOLOGY_TYPE);
4001+
pmu_set_mapping(type, ag, skx_iio_mapping_show, IIO_TOPOLOGY_TYPE);
40054002
}
40064003

4007-
static int skx_iio_set_mapping(struct intel_uncore_type *type)
4004+
static void skx_iio_set_mapping(struct intel_uncore_type *type)
40084005
{
4009-
return pmu_iio_set_mapping(type, &skx_iio_mapping_group);
4006+
pmu_iio_set_mapping(type, &skx_iio_mapping_group);
40104007
}
40114008

40124009
static void skx_iio_cleanup_mapping(struct intel_uncore_type *type)
@@ -4382,15 +4379,15 @@ static const struct attribute_group *skx_upi_attr_update[] = {
43824379
NULL
43834380
};
43844381

4385-
static int
4382+
static void
43864383
pmu_upi_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
43874384
{
4388-
return pmu_set_mapping(type, ag, skx_upi_mapping_show, UPI_TOPOLOGY_TYPE);
4385+
pmu_set_mapping(type, ag, skx_upi_mapping_show, UPI_TOPOLOGY_TYPE);
43894386
}
43904387

4391-
static int skx_upi_set_mapping(struct intel_uncore_type *type)
4388+
static void skx_upi_set_mapping(struct intel_uncore_type *type)
43924389
{
4393-
return pmu_upi_set_mapping(type, &skx_upi_mapping_group);
4390+
pmu_upi_set_mapping(type, &skx_upi_mapping_group);
43944391
}
43954392

43964393
static void skx_upi_cleanup_mapping(struct intel_uncore_type *type)
@@ -4773,9 +4770,9 @@ static int snr_iio_get_topology(struct intel_uncore_type *type)
47734770
return sad_cfg_iio_topology(type, snr_sad_pmon_mapping);
47744771
}
47754772

4776-
static int snr_iio_set_mapping(struct intel_uncore_type *type)
4773+
static void snr_iio_set_mapping(struct intel_uncore_type *type)
47774774
{
4778-
return pmu_iio_set_mapping(type, &snr_iio_mapping_group);
4775+
pmu_iio_set_mapping(type, &snr_iio_mapping_group);
47794776
}
47804777

47814778
static void snr_iio_cleanup_mapping(struct intel_uncore_type *type)
@@ -5391,14 +5388,14 @@ static int icx_iio_get_topology(struct intel_uncore_type *type)
53915388
return sad_cfg_iio_topology(type, icx_sad_pmon_mapping);
53925389
}
53935390

5394-
static int icx_iio_set_mapping(struct intel_uncore_type *type)
5391+
static void icx_iio_set_mapping(struct intel_uncore_type *type)
53955392
{
53965393
/* Detect ICX-D system. This case is not supported */
53975394
if (boot_cpu_data.x86_model == INTEL_FAM6_ICELAKE_D) {
53985395
pmu_clear_mapping_attr(type->attr_update, &icx_iio_mapping_group);
5399-
return -EPERM;
5396+
return;
54005397
}
5401-
return pmu_iio_set_mapping(type, &icx_iio_mapping_group);
5398+
pmu_iio_set_mapping(type, &icx_iio_mapping_group);
54025399
}
54035400

54045401
static void icx_iio_cleanup_mapping(struct intel_uncore_type *type)
@@ -5656,9 +5653,9 @@ static const struct attribute_group *icx_upi_attr_update[] = {
56565653
NULL
56575654
};
56585655

5659-
static int icx_upi_set_mapping(struct intel_uncore_type *type)
5656+
static void icx_upi_set_mapping(struct intel_uncore_type *type)
56605657
{
5661-
return pmu_upi_set_mapping(type, &icx_upi_mapping_group);
5658+
pmu_upi_set_mapping(type, &icx_upi_mapping_group);
56625659
}
56635660

56645661
static void icx_upi_cleanup_mapping(struct intel_uncore_type *type)
@@ -6125,9 +6122,9 @@ static const struct attribute_group *spr_upi_attr_update[] = {
61256122

61266123
#define SPR_UPI_REGS_ADDR_DEVICE_LINK0 0x01
61276124

6128-
static int spr_upi_set_mapping(struct intel_uncore_type *type)
6125+
static void spr_upi_set_mapping(struct intel_uncore_type *type)
61296126
{
6130-
return pmu_upi_set_mapping(type, &spr_upi_mapping_group);
6127+
pmu_upi_set_mapping(type, &spr_upi_mapping_group);
61316128
}
61326129

61336130
static void spr_upi_cleanup_mapping(struct intel_uncore_type *type)

0 commit comments

Comments
 (0)