From: alexander.antonov@linux.intel.com
To: peterz@infradead.org, linux-kernel@vger.kernel.org
Cc: kan.liang@linux.intel.com, alexey.v.bayduraev@linux.intel.com,
alexander.antonov@linux.intel.com
Subject: [PATCH 11/11] perf/x86/intel/uncore: Make set_mapping() procedure void
Date: Thu, 17 Nov 2022 12:28:33 +0000 [thread overview]
Message-ID: <20221117122833.3103580-12-alexander.antonov@linux.intel.com> (raw)
In-Reply-To: <20221117122833.3103580-1-alexander.antonov@linux.intel.com>
From: Alexander Antonov <alexander.antonov@linux.intel.com>
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>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
---
arch/x86/events/intel/uncore.h | 2 +-
arch/x86/events/intel/uncore_snbep.c | 41 +++++++++++++---------------
2 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index fac3612289f1..e278e2e7c051 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -94,7 +94,7 @@ struct intel_uncore_type {
* Optional callbacks for managing mapping of Uncore units to PMONs
*/
int (*get_topology)(struct intel_uncore_type *type);
- int (*set_mapping)(struct intel_uncore_type *type);
+ void (*set_mapping)(struct intel_uncore_type *type);
void (*cleanup_mapping)(struct intel_uncore_type *type);
};
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 4c2d5b5ea445..b8f9bd150b42 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3924,7 +3924,7 @@ static void pmu_clear_mapping_attr(const struct attribute_group **groups,
}
}
-static int
+static void
pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
ssize_t (*show)(struct device*, struct device_attribute*, char*),
int topology_type)
@@ -3943,8 +3943,6 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
if (ret < 0)
goto clear_topology;
- ret = -ENOMEM;
-
/* One more for NULL. */
attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL);
if (!attrs)
@@ -3968,7 +3966,7 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
}
ag->attrs = attrs;
- return 0;
+ return;
err:
for (; die >= 0; die--)
kfree(eas[die].attr.attr.name);
@@ -3979,7 +3977,6 @@ pmu_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag,
pmu_free_topology(type);
clear_attr_update:
pmu_clear_mapping_attr(type->attr_update, ag);
- return ret;
}
static void
@@ -3998,15 +3995,15 @@ pmu_cleanup_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
pmu_free_topology(type);
}
-static int
+static void
pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
{
- return pmu_set_mapping(type, ag, skx_iio_mapping_show, IIO_TOPOLOGY_TYPE);
+ pmu_set_mapping(type, ag, skx_iio_mapping_show, IIO_TOPOLOGY_TYPE);
}
-static int skx_iio_set_mapping(struct intel_uncore_type *type)
+static void skx_iio_set_mapping(struct intel_uncore_type *type)
{
- return pmu_iio_set_mapping(type, &skx_iio_mapping_group);
+ pmu_iio_set_mapping(type, &skx_iio_mapping_group);
}
static void skx_iio_cleanup_mapping(struct intel_uncore_type *type)
@@ -4382,15 +4379,15 @@ static const struct attribute_group *skx_upi_attr_update[] = {
NULL
};
-static int
+static void
pmu_upi_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
{
- return pmu_set_mapping(type, ag, skx_upi_mapping_show, UPI_TOPOLOGY_TYPE);
+ pmu_set_mapping(type, ag, skx_upi_mapping_show, UPI_TOPOLOGY_TYPE);
}
-static int skx_upi_set_mapping(struct intel_uncore_type *type)
+static void skx_upi_set_mapping(struct intel_uncore_type *type)
{
- return pmu_upi_set_mapping(type, &skx_upi_mapping_group);
+ pmu_upi_set_mapping(type, &skx_upi_mapping_group);
}
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)
return sad_cfg_iio_topology(type, snr_sad_pmon_mapping);
}
-static int snr_iio_set_mapping(struct intel_uncore_type *type)
+static void snr_iio_set_mapping(struct intel_uncore_type *type)
{
- return pmu_iio_set_mapping(type, &snr_iio_mapping_group);
+ pmu_iio_set_mapping(type, &snr_iio_mapping_group);
}
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)
return sad_cfg_iio_topology(type, icx_sad_pmon_mapping);
}
-static int icx_iio_set_mapping(struct intel_uncore_type *type)
+static void icx_iio_set_mapping(struct intel_uncore_type *type)
{
/* Detect ICX-D system. This case is not supported */
if (boot_cpu_data.x86_model == INTEL_FAM6_ICELAKE_D) {
pmu_clear_mapping_attr(type->attr_update, &icx_iio_mapping_group);
- return -EPERM;
+ return;
}
- return pmu_iio_set_mapping(type, &icx_iio_mapping_group);
+ pmu_iio_set_mapping(type, &icx_iio_mapping_group);
}
static void icx_iio_cleanup_mapping(struct intel_uncore_type *type)
@@ -5656,9 +5653,9 @@ static const struct attribute_group *icx_upi_attr_update[] = {
NULL
};
-static int icx_upi_set_mapping(struct intel_uncore_type *type)
+static void icx_upi_set_mapping(struct intel_uncore_type *type)
{
- return pmu_upi_set_mapping(type, &icx_upi_mapping_group);
+ pmu_upi_set_mapping(type, &icx_upi_mapping_group);
}
static void icx_upi_cleanup_mapping(struct intel_uncore_type *type)
@@ -6125,9 +6122,9 @@ static const struct attribute_group *spr_upi_attr_update[] = {
#define SPR_UPI_REGS_ADDR_DEVICE_LINK0 0x01
-static int spr_upi_set_mapping(struct intel_uncore_type *type)
+static void spr_upi_set_mapping(struct intel_uncore_type *type)
{
- return pmu_upi_set_mapping(type, &spr_upi_mapping_group);
+ pmu_upi_set_mapping(type, &spr_upi_mapping_group);
}
static void spr_upi_cleanup_mapping(struct intel_uncore_type *type)
--
2.25.1
next prev parent reply other threads:[~2022-11-17 12:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 12:28 [PATCH 00/11] UPI topology discovery for SKX/ICX/SPR alexander.antonov
2022-11-17 12:28 ` [PATCH 01/11] perf/x86/intel/uncore: Generalize IIO topology support alexander.antonov
2022-11-24 12:03 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 02/11] perf/x86/intel/uncore: Introduce UPI topology type alexander.antonov
2022-11-24 12:03 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 03/11] perf/x86/intel/uncore: Clear attr_update properly alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 04/11] perf/x86/intel/uncore: Disable I/O stacks to PMU mapping on ICX-D alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 05/11] perf/x86/intel/uncore: Generalize get_topology() for SKX PMUs alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 06/11] perf/x86/intel/uncore: Enable UPI topology discovery for Skylake Server alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 07/11] perf/x86/intel/uncore: Get UPI NodeID and GroupID alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 08/11] perf/x86/intel/uncore: Enable UPI topology discovery for Icelake Server alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 09/11] perf/x86/intel/uncore: Enable UPI topology discovery for Sapphire Rapids alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` [PATCH 10/11] perf/x86/intel/uncore: Update sysfs-devices-mapping file alexander.antonov
2022-11-24 12:02 ` [tip: perf/core] " tip-bot2 for Alexander Antonov
2022-11-17 12:28 ` alexander.antonov [this message]
2022-11-24 12:02 ` [tip: perf/core] perf/x86/intel/uncore: Make set_mapping() procedure void tip-bot2 for Alexander Antonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221117122833.3103580-12-alexander.antonov@linux.intel.com \
--to=alexander.antonov@linux.intel.com \
--cc=alexey.v.bayduraev@linux.intel.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox