From patchwork Fri Nov 25 11:39:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13055794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00301C4332F for ; Fri, 25 Nov 2022 11:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q7gb6J1Qn1MRfm4ZqUlL4aVro2h5HAntCzAA+FnK3Ss=; b=AJTmPzveQEmi6c AWG54xcRatEM88Xcotl31+R0Zu3mU63WA+SZDz2zVeooHcM7XR2nERyawDX0L/6LVTUNNB3X5/4By minNEMtcrVqsbj8hyvI0kSJUy1Eumo/pz825GB1at4BwYBBdJqpzl6RnC6GuXfbATvawT5Ig3eK0m yxtlUHRyrlmxA43jDFhPmpYMO5fd1vQAYJ0aO0eHqXNS3nyDpQz9/5HBX1JKOreBoBwYy5tKj92/J lxGSI8BJVi6aSsOxv6EZ0Qv/YzIfeilNZM5/4NtD0k/1Hl4VWN91Nxy0YLJ7uCV3MHeLL/KdusEEg g8utWEELpNOULd+fOzWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX4l-00GCai-Bm; Fri, 25 Nov 2022 11:40:59 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX3s-00GCS9-Oc for linux-riscv@lists.infradead.org; Fri, 25 Nov 2022 11:40:05 +0000 Received: by mail-ed1-x534.google.com with SMTP id z18so6004013edb.9 for ; Fri, 25 Nov 2022 03:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fmzKFonNfqlcEy1Te4vp2ov8Z3P9eAT/hbOKbET5tdY=; b=lnsLcSdnA8fVDy3tCT3/7QL8KuPyNmATf8xSrxJgvLsvpLGlThpF1k1fZ8myGNix4h F1g33VWauw2Z5jeQtVIi3Pm8bLy1s41jgsbLSiEM789CpBRWJSJcjEB9FFTrxSMtPjSj Up37ZUyk2nJImBFUB+F8l7gklSvSzHqP+O6rxxAjvmpe/jDiySIesEBTGT4f6gOVQ6jW y49UV1997Bp5nFlVaHnPWU+7z6nV0E1s1rEHbxYZhtoEF1YuxnLKwOQfTXSsv+t0jsAR h+ytxM4D5Jt5lKMJ1vLMzkUbBKQSJXQXuTfMXE86377NKAKbsjunJ7awxdc+cAO3bcxY uKxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fmzKFonNfqlcEy1Te4vp2ov8Z3P9eAT/hbOKbET5tdY=; b=VprJiq9YXoLAgeY4C9bABoaLGx9L6/RDzAieQUwvzwMnYiKVf9SxVo0SjPF/UW7LRX gSRPV82/IL1gHKUpJn77RkWkbu7OmXdzHbydc2qfiLiOR/hESYeAwmX1PaPsVwMHGw4F yB1HYNu+kAiokNNkUvWF4dl8ZhGaHgKHeOANYwkMQqoJIfsrnXq0oMc7xJr/RMM6W+75 qEYgE3QwImbgfDrgfGHSpWErT6NvNtB/1pl2N47QupdwzsXc3oYahVjZr1oRbF6LLHPN Pq3Lswa4X1CMZHehQR8eruWr82B08gScect/80yWRciVmLdtw6IpwiTdfmCAXxEuC7am DapA== X-Gm-Message-State: ANoB5pkatqQsdHK4s2TLDIO4r77woF/hqgAppDRSVD+BovYTdV0iDEKE D+EkhkdxnPXoWA7t77DhuO6eTCQn3NOetg== X-Google-Smtp-Source: AA0mqf6ANWWM2izcqEVfnIOe4islVzk7K/EEVogUy2I7cCfpUvEp9o8+fuud+rnYOmYFSsB2LbNtWw== X-Received: by 2002:a05:6402:360b:b0:468:f365:dca with SMTP id el11-20020a056402360b00b00468f3650dcamr19294896edb.41.1669376402978; Fri, 25 Nov 2022 03:40:02 -0800 (PST) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id q10-20020a170906b28a00b007b47748d22fsm1442967ejz.220.2022.11.25.03.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:40:02 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Conor Dooley , Lad Prabhakar , prabhakar.csengg@gmail.com Subject: [PATCH 1/4] riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2 Date: Fri, 25 Nov 2022 12:39:56 +0100 Message-Id: <20221125113959.35328-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125113959.35328-1-ajones@ventanamicro.com> References: <20221125113959.35328-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_034004_818236_1349C916 X-CRM114-Status: UNSURE ( 7.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Build __ALTERNATIVE_CFG_2 by adding on to __ALTERNATIVE_CFG rather than duplicating it. Signed-off-by: Andrew Jones --- arch/riscv/include/asm/alternative-macros.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index ec2f3f1b836f..64be770df89a 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -49,14 +49,7 @@ .macro __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ new_c_2, vendor_id_2, errata_id_2, enable_2 -886 : - .option push - .option norvc - .option norelax - \old_c - .option pop -887 : - ALT_NEW_CONTENT \vendor_id_1, \errata_id_1, \enable_1, \new_c_1 + __ALTERNATIVE_CFG old_c, new_c_1, vendor_id_1, errata_id_1, enable_1 ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2 .endm @@ -116,14 +109,7 @@ enable_1, \ new_c_2, vendor_id_2, errata_id_2, \ enable_2) \ - "886 :\n" \ - ".option push\n" \ - ".option norvc\n" \ - ".option norelax\n" \ - old_c "\n" \ - ".option pop\n" \ - "887 :\n" \ - ALT_NEW_CONTENT(vendor_id_1, errata_id_1, enable_1, new_c_1) \ + __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ ALT_NEW_CONTENT(vendor_id_2, errata_id_2, enable_2, new_c_2) #define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ From patchwork Fri Nov 25 11:39:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13055795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 605EDC4332F for ; Fri, 25 Nov 2022 11:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zOwjvgKc9fYA1fxlEjpZk0uGCzzM4NxaOgOuYv2dxOA=; b=vzVbOFpmBum5uM n/qZVkckC4I4d9RwxJDX1MG/ZC4lkv9jiQ4lwkkQ/MK9kvx3GM3XZ7j5bdkXW+iwp/ga5lCZ6DOzn ieRChhhBSrySQ7hVZDdwjiTpCcGkVFrvuIhDshl6l7nq1ei75vihkN/zxWkRrb9lAeepLZAWI/w2/ GQ6G8k/8RkvXO5RUSn1GWFRMtyLb0tOJ4mM7gN/d6iHpq75rkMyPGftzrznT+LcSdZQPlKw0YT/CN uOfneT+/uM8oAvzX5duRJqNbFT2nsoZYUO0YYDoenSbHnEXgqe9slAwUDCvBAYIxFE3Zf3bckNDrl AZfWxYOMc1oWw+WELzFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX4n-00GCbv-Vd; Fri, 25 Nov 2022 11:41:02 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX3v-00GCSh-8Y for linux-riscv@lists.infradead.org; Fri, 25 Nov 2022 11:40:08 +0000 Received: by mail-ej1-x630.google.com with SMTP id i10so9730506ejg.6 for ; Fri, 25 Nov 2022 03:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=et7jrcUCp46TKBjZ9I47RbmQBloFSNNuzFRXSOjWq2M=; b=Era7s6v6ZoORekTq/pfcDVNDTYXpL/GJswUCb2//uNsETOxixHYolthkWSOeK/2U2e mDKN89emNebw23uzhauvnFGDK8UvwxNExj+3d5/1CVu+seOn9C7PDJkFIJ9O0e8ZjYwC RB8IoCqqvbyei4R/z+/ZLGkjHzioOVFnWGqHHQi8IEAiT+NcognZbma7gxGMBcX8LuxS OKU6Kc3O0M7kmwNOv1COB4E3qwkMCdt1e4CwbCeW/kcW2xwhyAaYTsiP8VU9vlj/SZX+ WTJkNmQLs/UOpeNDWeds4jRirS9tI3mGyfcYlWjzemo4dFyb7Tuwo0N5+32Lh/DFNno8 L+Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=et7jrcUCp46TKBjZ9I47RbmQBloFSNNuzFRXSOjWq2M=; b=oTJVrndN6cDKIqe67ixIGRWrGNzueiy7TwUbMpUOm4Z9orLpuomU2zLvmrjZ9q9ovM Ln8myxwDwtxDQmq5QtK7ohfkWCsg8m1IeZqREjeDqu3tp3c4FvheewC79nJkl0CNRpIk mXdFoxFDCed0NoFZLn1S2zT0oM10HOnJwgZtXGV4pWjvExPAkO732YcCYos+lFEZ/hlO bBS9WcnS6uP/KuMcejx/hFGDCM06NlblDLrmS2mvdauwgqlbGz+CWBWZnlzZfUx6yXOd FseToVsnktBkGvVj4bKg/Li3oEyMXwIhHLMMKNZ1fmSH9GnK4SWiMVOGDrx3SXGylexk BtWg== X-Gm-Message-State: ANoB5plY8OVH0kN/Osp0Fzol3xrVvrNknzCU3ikhwq0e8T1QMEYtHqNB sY88pnKnNzQzrdezOPaULnske+3eOSfBLg== X-Google-Smtp-Source: AA0mqf5rJeOOSAGT+xS/tYNxs9fWZX5go1DhRPqWSkIBHakNNUV3GU4hnZAdRjMtxNZ2KGtGEkF3QA== X-Received: by 2002:a17:906:901:b0:7ae:23c:3cb4 with SMTP id i1-20020a170906090100b007ae023c3cb4mr30951887ejd.599.1669376404420; Fri, 25 Nov 2022 03:40:04 -0800 (PST) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id b12-20020aa7c6cc000000b0046ab2bd784csm803085eds.64.2022.11.25.03.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:40:04 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Conor Dooley , Lad Prabhakar , prabhakar.csengg@gmail.com Subject: [PATCH 2/4] riscv: alternatives: Don't name unused macro parameters Date: Fri, 25 Nov 2022 12:39:57 +0100 Message-Id: <20221125113959.35328-3-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125113959.35328-1-ajones@ventanamicro.com> References: <20221125113959.35328-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_034007_317223_D7DE7755 X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Without CONFIG_RISCV_ALTERNATIVE only the first parameter of the ALTERNATIVE macros is needed. Use ... for the rest to cut down on clutter. While there, fix a couple space vs. tab issues. Signed-off-by: Andrew Jones --- arch/riscv/include/asm/alternative-macros.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index 64be770df89a..a5a8a2a3c267 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -130,28 +130,22 @@ \old_c .endm -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ +#define _ALTERNATIVE_CFG(old_c, ...) \ __ALTERNATIVE_CFG old_c -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - CONFIG_k_1, \ - new_c_2, vendor_id_2, errata_id_2, \ - CONFIG_k_2) \ - __ALTERNATIVE_CFG old_c +#define _ALTERNATIVE_CFG_2(old_c, ...) \ + __ALTERNATIVE_CFG old_c #else /* !__ASSEMBLY__ */ -#define __ALTERNATIVE_CFG(old_c) \ +#define __ALTERNATIVE_CFG(old_c) \ old_c "\n" -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ +#define _ALTERNATIVE_CFG(old_c, ...) \ __ALTERNATIVE_CFG(old_c) -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - CONFIG_k_1, \ - new_c_2, vendor_id_2, errata_id_2, \ - CONFIG_k_2) \ - __ALTERNATIVE_CFG(old_c) +#define _ALTERNATIVE_CFG_2(old_c, ...) \ + __ALTERNATIVE_CFG(old_c) #endif /* __ASSEMBLY__ */ #endif /* CONFIG_RISCV_ALTERNATIVE */ From patchwork Fri Nov 25 11:39:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13055793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D428EC43217 for ; Fri, 25 Nov 2022 11:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A9ycQVRV4KywF/32vH7zZGnM/tJwtj0rVwvzT4xoRt0=; b=FHL/5tFSPH/kSr lPae6SnMVeRd/kg4uUXgxGlHM6AFLtGvUDry/Xnma+95qVqaSahpionSgfoHmxfVY8cqsbFjBxGS/ /Z9H3HNoUiy5N8WBpGYT9EnMi2wBEhPlb65CL4cX110EsYk+Yy9cohEe4QaHo3KE7aadtIWE8WYXN h5mH8X+whbq470p9vkQzlJHZ/kh1aSR4rysjPuhTOwDwt73IbN8xHAsmIgVcPqDsgnrzDhYD8bAFp XeQnjqYMa3bFq+6wefl9/iKLVHnJ8nttf2i2G03bUEhKtTeGI+4Ua4Qxcla13uUz+lWom+OwIqgeU 40uw+E9SYOEguMjM9WcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX4j-00GCZp-Dc; Fri, 25 Nov 2022 11:40:57 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX3y-00GCSq-Ep for linux-riscv@lists.infradead.org; Fri, 25 Nov 2022 11:40:11 +0000 Received: by mail-ej1-x629.google.com with SMTP id vp12so8435553ejc.8 for ; Fri, 25 Nov 2022 03:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nV5LY+KYbZtIwHR9OBDHLg6Er1hmrO5M3v1yt7YuVaE=; b=o9NBSLU5WZur5ijb330JEa0cmdAtk8K7vnlqP+z7P5QEoooO5+L2Iv7T03j18B3G51 ia4AC6pEhqTCy0EbYIgen3BAfg44MnWPBHHqD131+4NsbU/RDXyMlQrCcI6wfenz64M8 sQkmyq6LOEKS/244ZwlbHgYke7ViDZdVeorFEfYAtg6p099KgwkLlWU+O1eKwqIM/MhI 9Mrd+CJH0kp0d4a3dp3lRaJHUrj0jSVfy3i5jxoedyHWj+WZelHYAPd4PaOwnWRYrMo5 EoVFJtKSNIAd9XZtSwdHaUS5kvCbxWKBwgKvn8Gk3QQJEA7xoyId2bB7qGp0WYInRJl+ nqOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nV5LY+KYbZtIwHR9OBDHLg6Er1hmrO5M3v1yt7YuVaE=; b=XS2v4pTYdT3Dixy3cr4X/NAqE4kAX4xHu4bqHm1mKKo5ECGdH6hDF2aCSEXSW4QbSA zNTxfPykhoqcMxSLM/NI2ZEHAv0asnqNsazzcHTyVIQd8xG5EN29ihx063T/4Tx5awMg 4ODQ9K8yrz9A9OkXoqfSvXqh9vtcGyNdvzEoWbWrnnfQZSAwY0uMWZzEQd+HdwFBr49y 2fdn7Hb2xiUHQsSDAixfJDYCmTvKZIXrGz0SxFE2NCSWFTnXGfzBYwiiRV4pxP2J06Kx qE8oK71Lk1lh9m1gftLhpM1eucOjESX5ZY4JimSCpdrZgj+R1wsJkQhTz02n0+t4Sh3e taBg== X-Gm-Message-State: ANoB5pnjEjEQTwUuBgKTHiSXXWIa2WylZjvISmy9yoirxuLJmqZzp7tG ve7OlkPobQ/ZX+20OhMBdNjJCcqPeNMmTw== X-Google-Smtp-Source: AA0mqf63XBS8Xs+q8StDcIV6Dct81i6NvBPJjACX3xxlXEPsi3GBq49xKAP3VLlDNlZ+rEsg3NlFkA== X-Received: by 2002:a17:906:bb06:b0:7ba:708f:2a03 with SMTP id jz6-20020a170906bb0600b007ba708f2a03mr8879003ejb.167.1669376405933; Fri, 25 Nov 2022 03:40:05 -0800 (PST) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id pk3-20020a170906d7a300b0078d38cda2b1sm1459159ejb.202.2022.11.25.03.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:40:05 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Conor Dooley , Lad Prabhakar , prabhakar.csengg@gmail.com Subject: [PATCH 3/4] riscv: alternatives: Drop the underscores from the assembly macro names Date: Fri, 25 Nov 2022 12:39:58 +0100 Message-Id: <20221125113959.35328-4-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125113959.35328-1-ajones@ventanamicro.com> References: <20221125113959.35328-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_034010_510155_D7D8B573 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The underscores aren't needed because there isn't anything already named without them and the _CFG extension. This is a bit of a cleanup by itself, but the real motivation is for a coming patch which would otherwise need to add two more underscores to these macro names, i.e. ____ALTERNATIVE_CFG, and that'd be gross. Signed-off-by: Andrew Jones --- arch/riscv/include/asm/alternative-macros.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index a5a8a2a3c267..68dc349b0876 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -33,7 +33,7 @@ .endif .endm -.macro __ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable +.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable 886 : .option push .option norvc @@ -45,11 +45,11 @@ .endm #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ - __ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k) + ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k) -.macro __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ - new_c_2, vendor_id_2, errata_id_2, enable_2 - __ALTERNATIVE_CFG old_c, new_c_1, vendor_id_1, errata_id_1, enable_1 +.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ + new_c_2, vendor_id_2, errata_id_2, enable_2 + ALTERNATIVE_CFG old_c, new_c_1, vendor_id_1, errata_id_1, enable_1 ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2 .endm @@ -57,9 +57,9 @@ CONFIG_k_1, \ new_c_2, vendor_id_2, errata_id_2, \ CONFIG_k_2) \ - __ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, \ + ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, \ IS_ENABLED(CONFIG_k_1), \ - new_c_2, vendor_id_2, errata_id_2, \ + new_c_2, vendor_id_2, errata_id_2, \ IS_ENABLED(CONFIG_k_2) #else /* !__ASSEMBLY__ */ @@ -126,15 +126,15 @@ #else /* CONFIG_RISCV_ALTERNATIVE */ #ifdef __ASSEMBLY__ -.macro __ALTERNATIVE_CFG old_c +.macro ALTERNATIVE_CFG old_c \old_c .endm #define _ALTERNATIVE_CFG(old_c, ...) \ - __ALTERNATIVE_CFG old_c + ALTERNATIVE_CFG old_c #define _ALTERNATIVE_CFG_2(old_c, ...) \ - __ALTERNATIVE_CFG old_c + ALTERNATIVE_CFG old_c #else /* !__ASSEMBLY__ */ From patchwork Fri Nov 25 11:39:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13055796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98A59C4332F for ; Fri, 25 Nov 2022 11:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/ZUX0vMQA5EvoQUCf7rkj5agU+3I6rRyx0AMNpIR+uw=; b=DoH2eSUpn50bTr 2hXopFznB8B4AEi8Q1/4iuRxH6z52kCQ0qb6rcd9vuF67XVNOvqZxB6GHv3rE03VatGY6XQWnhc0V wUNZN5SmhlyXQIycL+6JCy/GkQhPvo0fQbNYZp7Uqai+kQkOrFA4bhQ9JBIPmPh/PUt0i5Ybv1EYx ebbucQNgQOv8uSVYYrTbqDJpAb1OIBdUNdRlYmLdx+nywCXie3yaMfLTEvhYoRrvfoDKqGOHPLQ/p Aqp5dFGYhZl1IK7rtgIrSds632x7nn5id0zCiXUkZYX/gavHPXBL1La+DvFzLbtLgPhur3ogYIvUA p2rl3qK9e0TvLO3P8zsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX4q-00GCdG-D6; Fri, 25 Nov 2022 11:41:04 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyX3z-00GCT7-QO for linux-riscv@lists.infradead.org; Fri, 25 Nov 2022 11:40:13 +0000 Received: by mail-ej1-x633.google.com with SMTP id n20so9838717ejh.0 for ; Fri, 25 Nov 2022 03:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KlV2yWnaNP4MP0ekNYYC2os9eM9R4hyLBeccW6i6bno=; b=fkLWc+YRPJk3iKGbaEGZYb89IB4DAUYA3eyFbOmo8EAQ/yzppHdLtkYXOOIn9e/sdD YTSwkoW/fdIdAMEy4NOs4n/JfHKLOT+iEPoiC2r4QfJntPXGgn1x6fIEJMJDkVB0KIgh t1USMkY0vjtHVdzl5rzjO/DdWelFyt0AGEocxq+ZQVZ+PhZsu1vkEflBvOMsLd+9wKNn WpFDJRWez7G0dXvmuUi/oyuQ4QPZo4BPZXdgJY98jhcxy+FPvep+CtEL1NRnJF5YZgfa 3ioK5LW+iWOTCTYGRqDTwx/fj5MR3iwXe5bbUZa8kN8piKbi1GYl6YIEW6U3sAdeItfp 4fKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KlV2yWnaNP4MP0ekNYYC2os9eM9R4hyLBeccW6i6bno=; b=wQENR5ycA3ytZ6dGHl0jTrKTpKlBwh8dbmnSxbvPjVkkeqJ82Je6MiyOoqyKPHwAlr Sgc0bQ+HZB6H8U0zHisGBJsW1juNMTETvzUg6/CUhZRcJAl9uoMBawvEixfme1E3+Vrj wTHmSkiwNmqDz8BSdDG+BWqM29x+FXN4FD7NOCx+e01bC9mRfvqE/mEgGq0AYZpCzyzw wxfazhyvLDe6SlUolQUhs9MVhfYX1scm9F/VKCyI1Xi90zgSJRQirkG4SZRvVW6jRJSx oqDIVn/ZDDWX+oXPRarfXZ+haBPMmkC8d7j0ruudk3GlNQJvXigKRWPBoEQA5aW7ei7l tzkw== X-Gm-Message-State: ANoB5pkVls/gl01uLVSS/C0BelkOwP6UhC4ri/1jLR4uR3Q2AzZdAfWo RFnck4hemYs8HoLDgXHd/QSJhPwPjo9psA== X-Google-Smtp-Source: AA0mqf4u9x38az4/itHsBDGfjn5ujSIyqp3JenluIT+ALz2e7EnpKB9L680JeD4MAppZo8RcAbn70w== X-Received: by 2002:a17:906:a08e:b0:7ad:79c0:5479 with SMTP id q14-20020a170906a08e00b007ad79c05479mr23630101ejy.392.1669376407286; Fri, 25 Nov 2022 03:40:07 -0800 (PST) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id r2-20020a17090609c200b00783f32d7eaesm1446172eje.164.2022.11.25.03.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:40:06 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Stuebner , Conor Dooley , Lad Prabhakar , prabhakar.csengg@gmail.com Subject: [PATCH 4/4] riscv: Don't duplicate _ALTERNATIVE_CFG* macros Date: Fri, 25 Nov 2022 12:39:59 +0100 Message-Id: <20221125113959.35328-5-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125113959.35328-1-ajones@ventanamicro.com> References: <20221125113959.35328-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_034011_872010_7A087B87 X-CRM114-Status: UNSURE ( 9.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Reduce clutter by only defining the _ALTERNATIVE_CFG* macros once, rather than once for assembly and once for C. To do that, we need to add __ALTERNATIVE_CFG* macros to the assembly side, but those are one-liners. Also take the opportunity to do a bit of reformatting, taking full advantage of the fact checkpatch gives us 100 char lines. Signed-off-by: Andrew Jones --- arch/riscv/include/asm/alternative-macros.h | 53 +++++++-------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index 68dc349b0876..a6c4f8ed41d3 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -44,23 +44,14 @@ ALT_NEW_CONTENT \vendor_id, \errata_id, \enable, \new_c .endm -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ - ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k) - .macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ new_c_2, vendor_id_2, errata_id_2, enable_2 ALTERNATIVE_CFG old_c, new_c_1, vendor_id_1, errata_id_1, enable_1 ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2 .endm -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - CONFIG_k_1, \ - new_c_2, vendor_id_2, errata_id_2, \ - CONFIG_k_2) \ - ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, \ - IS_ENABLED(CONFIG_k_1), \ - new_c_2, vendor_id_2, errata_id_2, \ - IS_ENABLED(CONFIG_k_2) +#define __ALTERNATIVE_CFG(...) ALTERNATIVE_CFG __VA_ARGS__ +#define __ALTERNATIVE_CFG_2(...) ALTERNATIVE_CFG_2 __VA_ARGS__ #else /* !__ASSEMBLY__ */ @@ -102,27 +93,21 @@ "887 :\n" \ ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ - __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) - -#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - enable_1, \ - new_c_2, vendor_id_2, errata_id_2, \ - enable_2) \ - __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ +#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ + new_c_2, vendor_id_2, errata_id_2, enable_2) \ + __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ ALT_NEW_CONTENT(vendor_id_2, errata_id_2, enable_2, new_c_2) -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - CONFIG_k_1, \ - new_c_2, vendor_id_2, errata_id_2, \ - CONFIG_k_2) \ - __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ - IS_ENABLED(CONFIG_k_1), \ - new_c_2, vendor_id_2, errata_id_2, \ - IS_ENABLED(CONFIG_k_2)) - #endif /* __ASSEMBLY__ */ +#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ + __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) + +#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ + new_c_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ + __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, IS_ENABLED(CONFIG_k_1), \ + new_c_2, vendor_id_2, errata_id_2, IS_ENABLED(CONFIG_k_2)) + #else /* CONFIG_RISCV_ALTERNATIVE */ #ifdef __ASSEMBLY__ @@ -173,13 +158,9 @@ * on the following sample code and then replace ALTERNATIVE() with * ALTERNATIVE_2() to append its customized content. */ -#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, \ - errata_id_1, CONFIG_k_1, \ - new_content_2, vendor_id_2, \ - errata_id_2, CONFIG_k_2) \ - _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, \ - errata_id_1, CONFIG_k_1, \ - new_content_2, vendor_id_2, \ - errata_id_2, CONFIG_k_2) +#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ + new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ + _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ + new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) #endif