* [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure
@ 2026-09-03 8:15 Thomas Richter
2026-09-08 7:32 ` Sumanth Korikkar
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richter @ 2026-09-03 8:15 UTC (permalink / raw)
To: linux-s390, japo, sumanthk; +Cc: Thomas Richter
Code simplification and remove variable state.
Return -ENODEV in all failures to indicate the PAI PMUs are not
available.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
arch/s390/kernel/perf_pai.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/s390/kernel/perf_pai.c b/arch/s390/kernel/perf_pai.c
index 013c3dae21ec..b6c9dca09510 100644
--- a/arch/s390/kernel/perf_pai.c
+++ b/arch/s390/kernel/perf_pai.c
@@ -1304,7 +1304,7 @@ static int pai_offline_cpu(unsigned int cpu)
static int __init pai_init(void)
{
- int state, rc;
+ int rc;
/* Setup s390dbf facility */
paidbg = debug_register("pai", 1, 1, 128);
@@ -1315,23 +1315,21 @@ static int __init pai_init(void)
debug_register_view(paidbg, &debug_sprintf_view);
/* CPUHP_BP_PREPARE_DYN --> before CPU is brought online */
- state = cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "perf/pai:prepare",
- pai_online_cpu, pai_offline_cpu);
- rc = state < 0 ? state : 0;
+ rc = cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "perf/pai:prepare",
+ pai_online_cpu, pai_offline_cpu);
if (rc < 0)
goto out_debug;
- rc = -ENODEV;
if (!paipmu_setup())
goto out_cpuhp;
return 0;
out_cpuhp:
- cpuhp_remove_state(state);
+ cpuhp_remove_state(rc);
out_debug:
debug_unregister_view(paidbg, &debug_sprintf_view);
debug_unregister(paidbg);
- return rc;
+ return -ENODEV;
}
device_initcall(pai_init);
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure
2026-09-03 8:15 [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure Thomas Richter
@ 2026-09-08 7:32 ` Sumanth Korikkar
0 siblings, 0 replies; 2+ messages in thread
From: Sumanth Korikkar @ 2026-09-08 7:32 UTC (permalink / raw)
To: Thomas Richter; +Cc: linux-s390, japo
On Thu, Sep 03, 2026 at 10:15:57AM +0200, Thomas Richter wrote:
> Code simplification and remove variable state.
> Return -ENODEV in all failures to indicate the PAI PMUs are not
> available.
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Looks good to me.
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-08 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 8:15 [PATCH] s390/pai: Simplify pai_init() and always return -ENODEV on failure Thomas Richter
2026-09-08 7:32 ` Sumanth Korikkar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.