[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221228161915.13194-3-samuel@sholland.org>
Date: Wed, 28 Dec 2022 10:19:14 -0600
From: Samuel Holland <samuel@...lland.org>
To: Palmer Dabbelt <palmer@...belt.com>,
Dmitry Osipenko <dmitry.osipenko@...labora.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>
Cc: Samuel Holland <samuel@...lland.org>,
Albert Ou <aou@...s.berkeley.edu>,
Anup Patel <apatel@...tanamicro.com>,
Atish Patra <atishp@...osinc.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Heiko Stuebner <heiko@...ech.de>,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
Luis Chamberlain <mcgrof@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Petr Mladek <pmladek@...e.com>,
YueHaibing <yuehaibing@...wei.com>, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, tangmeng <tangmeng@...ontech.com>
Subject: [PATCH 2/3] riscv: sbi: Share the code for unsupported extension warnings
This reduces the code size by sharing most of the code and the format
string across all affected extensions.
Signed-off-by: Samuel Holland <samuel@...lland.org>
---
arch/riscv/kernel/sbi.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c
index 5c87db8fdff2..1196c12299f6 100644
--- a/arch/riscv/kernel/sbi.c
+++ b/arch/riscv/kernel/sbi.c
@@ -210,16 +210,20 @@ static void sbi_set_power_off(void)
pm_power_off = sbi_shutdown;
}
#else
+static void __sbi_warn_unsupported(const char *extension)
+{
+ pr_warn("%s extension is not available in SBI v%lu.%lu\n",
+ extension, sbi_major_version(), sbi_minor_version());
+}
+
static void __sbi_set_timer_v01(uint64_t stime_value)
{
- pr_warn("Timer extension is not available in SBI v%lu.%lu\n",
- sbi_major_version(), sbi_minor_version());
+ __sbi_warn_unsupported("Timer");
}
static int __sbi_send_ipi_v01(const struct cpumask *cpu_mask)
{
- pr_warn("IPI extension is not available in SBI v%lu.%lu\n",
- sbi_major_version(), sbi_minor_version());
+ __sbi_warn_unsupported("IPI");
return 0;
}
@@ -228,8 +232,7 @@ static int __sbi_rfence_v01(int fid, const struct cpumask *cpu_mask,
unsigned long start, unsigned long size,
unsigned long arg4, unsigned long arg5)
{
- pr_warn("remote fence extension is not available in SBI v%lu.%lu\n",
- sbi_major_version(), sbi_minor_version());
+ __sbi_warn_unsupported("Remote fence");
return 0;
}
--
2.37.4
Powered by blists - more mailing lists