Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4781436rwl; Wed, 28 Dec 2022 08:43:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJPU0I4Mekbt2LsNAoHRo0I2xJQmjrEpp7/dF+gMIO6zFw+0oDWmtS6FtYz5WY1UWYcazr X-Received: by 2002:a17:906:5dd2:b0:7c1:7010:f413 with SMTP id p18-20020a1709065dd200b007c17010f413mr25248783ejv.19.1672245817316; Wed, 28 Dec 2022 08:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672245817; cv=none; d=google.com; s=arc-20160816; b=tTqctMurRBzAzemp36tOeWMhTekEAscby0p03NlUlyiSTN3okTXuKmaIOHhkDwudxz mSsdx5uPhBWC/cSwT90X3EhPJSjpI9Ei49uta4IVvIrKfgZxnQYUkm+QtP+3MdYggCku WgHWyzNPsE2bUXGfRWjgfRpiSHn7EO7brNt9Ycelkq+jYe9gkmNoJvNFHoeVozSOJv1o 1xAVWH6hkLYpV/6xRyVaVxAdbBem88yWhX1H4wpv60g6P9VQNEGPvnkYcq6cVcoGEtP3 PMcoCIetiI8NdxEGD2cZMtYvNinNlBeq11cECpb6AzEBoG8AO3MZhfgYqSeIigqRxhHc EWtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=ESstYnp5wyCE49c6/wy64Qn4j/wTNxpyUZDW8WgeRUg=; b=mAHNiGMnYqodtVKTC3dQf2nKfABQttrconOrmplxpFp4HBILeoONaTzEhqa4KadVZc C+obLm7in7uHXRVxKkTHDQS3r0juA9cpRnGODT4STYN1rtICzacfBpcKbaw/rBs13+Og Ejx4mqb3ogrFZYGpNXsyL1UXFZhjCxdKoC40NY6Wr3YEpeFwaqZC/QTv5H1CSlc+YIi5 O+aLAIH1hPW0nsIk1BXMIvYs/ozlfkvs/8tS7phb2skQP69kndYspwKIdiQGIC12E3Q1 yCm0okfpTPkgwOa3yid7PHYNYvctQFR7dOmI75FvdSqJKv7os+TZ27Olzt+zDSK4dp83 S1Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=KGPw76T8; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HmXYANKp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn21-20020a17090794d500b007a087ccd275si15284183ejc.384.2022.12.28.08.43.22; Wed, 28 Dec 2022 08:43:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=KGPw76T8; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HmXYANKp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233372AbiL1QW6 (ORCPT + 64 others); Wed, 28 Dec 2022 11:22:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234445AbiL1QVY (ORCPT ); Wed, 28 Dec 2022 11:21:24 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDDC1B796 for ; Wed, 28 Dec 2022 08:19:22 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EBBFE5C018A; Wed, 28 Dec 2022 11:19:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 28 Dec 2022 11:19:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1672244361; x=1672330761; bh=ES stYnp5wyCE49c6/wy64Qn4j/wTNxpyUZDW8WgeRUg=; b=KGPw76T8n9MIoY9Oog 5UaC3+g6MNNikDTuxkQ4OAuqigX6iTB3WI4R4Sk2uXqOKSqCGlnxKQAoO1BjwqNN he8M+zq2JjzvpS0ot0vIfuvCpwG2LzU7uB5W8xpL5Gctu51tYHgkXEdtA1QzOKQm OiNjf2Aqz3+GAccv3ggUvuItBTG3r47dxR+6HRJfaTWKtmGIq6TEQrQUGiY8BJdx 3Uj6zgyEF4ONDf6EdlUW4BoUD/VKO2pPNzpVdupP6TgL0pBdkX7AnOD9YdwmKsjM MGcqjK9iCpxA+QzbzBKp+ZkcuytmmHnQ3CHL2vTKf/2zaC+gAAmgPcj16asE1nTx daPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1672244361; x=1672330761; bh=ESstYnp5wyCE4 9c6/wy64Qn4j/wTNxpyUZDW8WgeRUg=; b=HmXYANKpWMSa6HeXX9i9y1m493z9A HUeDYwPYYbRqMVqN5vrsMkn7f03KMMc0/NRYQKzIKuXx2tFPFTczPkvCgP2CMBWN Rj3bZDhT/zn6JnqMW1OR2HeQh0NTLMBxcUEreyZsXOseWS/srZGbIpOEV9xXm9K4 /rE7uvzfg33XRbit+JUF3L8kYDN163hqwxuVvFDIcxnu1Td3c6bw843Am2khLZMY Rf30Bb7vk7KFGFdn/KqFW1fKjV0qfP9lehYVcFXpd9YxMLmbP+6Xl2yTgIFxWCKS mZcdr2antmAc6VhECZkiCn9bVphwwgtX9UmCWfQMStTYm0Um+IbNf9dKg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedriedvgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Dec 2022 11:19:20 -0500 (EST) From: Samuel Holland To: Palmer Dabbelt , Dmitry Osipenko , "Rafael J . Wysocki" Cc: Samuel Holland , Albert Ou , Anup Patel , Atish Patra , Geert Uytterhoeven , Heiko Stuebner , Kai-Heng Feng , Luis Chamberlain , "Paul E. McKenney" , Paul Walmsley , Petr Mladek , YueHaibing , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, tangmeng Subject: [PATCH 2/3] riscv: sbi: Share the code for unsupported extension warnings Date: Wed, 28 Dec 2022 10:19:14 -0600 Message-Id: <20221228161915.13194-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221228161915.13194-1-samuel@sholland.org> References: <20221228161915.13194-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reduces the code size by sharing most of the code and the format string across all affected extensions. Signed-off-by: Samuel Holland --- 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