From patchwork Tue Nov 29 15:00:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13058689 X-Patchwork-Delegate: palmer@dabbelt.com 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 2A8C4C433FE for ; Tue, 29 Nov 2022 15:01:12 +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=Y6KVolI6UQCpIBOyMB+78Azm19au2xAY2lHqw6XEGSI=; b=su9oXg4QBXsK3k QTkkZhQf4XZCaOJvJV3/P0hU/17qdZkMG6yfKFjVDVt3AqUm0Jx2e3TegC+fEZKLfECVNMTT9y6++ ng6Vl4J5XTVZIlkXfrG4FNTiyJ9z9PhP6ZwPxfbUx+MYDJkBgTnvJOVXzjURA0rIX6FjUtngpVOMa 5XmKk0m+1qtywlIwN94n8egfqt9czQUErSD4u12L07fyGTjkorOdCuLFsP5hRqxU0+WkIBxQHrg6m gv4PjrFAzUzl+gooYZfq6SWy1F7itWg2Tmj632Vs15Br1QPBtbOycdD5a4qmG7/59Nblu/zMpJyHj dfIpXRQ0IbHWWwnxT3Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026X-009X5V-AT; Tue, 29 Nov 2022 15:01:01 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026U-009X3K-I2 for linux-riscv@lists.infradead.org; Tue, 29 Nov 2022 15:00:59 +0000 Received: by mail-ed1-x52a.google.com with SMTP id e13so20136360edj.7 for ; Tue, 29 Nov 2022 07:00:58 -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=1ZMgtPJyknCU4P1laaEEgl8wws7dZ3Vt3VftbenAHZw=; b=gUhNYIl5KiKZ+8Gc8bVYxCS9he8wLeijh3GI5x29qaSIzDOO3tbQBd4L+VgMOwDPfA szPXUpAdGNkuXyzCdgQycgYThAvfwPBvp+OL1euQA8H3H8W/6TDpS3SQVQg45gfMO2+N Bm1U8mJme0xyZw4oEDm0lEOPcH7xeqvUwnvq+ANg8dyVFOdowcKlCl9I7fehGO7nFlvp zL7jFj8kh9xBaPsgXw0/l8zpvd7kSjnh1tfZAODBRSUtASzJr2Uh1Z29Pa+scuwcbC5s baTjyb5DrcSc3kwjLgfCP6MKUjD5UInEk4mJFuJZzhlSm3u5Q37mfFURimA23cT2aw2q v3CQ== 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=1ZMgtPJyknCU4P1laaEEgl8wws7dZ3Vt3VftbenAHZw=; b=n9lLpAiVD3CPicYKGHxZYaDRlrPzKSeAbngWFuGazXEw2mcF2IUIadvJyIpltx6rzM m1mXKSaAb9f/XY6HXVzDr23Y4XkLZACB7bJ2axQmQQMayZW7bulwBqThM8jp5pPeF1fK lSTNM31cBu51nJlM3S0BkZZEmNJIcRmaYaogZT+A8ir/9YmRI4I5rUPpqh5NQEg46xGX 3gAFCRY3ADHb7BUueVtnULFW+jBEuHOY76ACW3GVHMnQsw04Jap9yfWgT811IalqYKUq hJeJuIqgUzpiXvseDLaWxAjSzPReT9Vvcg3UJb/HZVbrXOoV0qimwkfeHEguLXNzev0X AGLQ== X-Gm-Message-State: ANoB5pmBPnHs9I2SOpNlCv7wk2+5ciQS6yZvjKcyuIBAwrXFDky7zvBf ELxUIV17qei3bk+pLeFuE0S46wnEOVw1Mw== X-Google-Smtp-Source: AA0mqf7uTCfJvsjsplKyHlSYAEtsM2IS/3wvUGZNWvvT3qGotsC3XTxsNvUuuaoOYSzyRuYN5IGuVQ== X-Received: by 2002:a05:6402:4028:b0:467:c33e:edd6 with SMTP id d40-20020a056402402800b00467c33eedd6mr28359664eda.146.1669734057120; Tue, 29 Nov 2022 07:00:57 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-748-2a9a-a2a6-1362.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:748:2a9a:a2a6:1362]) by smtp.gmail.com with ESMTPSA id 10-20020a170906310a00b007b8a8fc6674sm6282391ejx.12.2022.11.29.07.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 07:00:56 -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 v2 1/4] riscv: Don't duplicate __ALTERNATIVE_CFG in __ALTERNATIVE_CFG_2 Date: Tue, 29 Nov 2022 16:00:50 +0100 Message-Id: <20221129150053.50464-2-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129150053.50464-1-ajones@ventanamicro.com> References: <20221129150053.50464-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_070058_628535_D5067CBD X-CRM114-Status: UNSURE ( 8.54 ) 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 Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner --- 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..c7036166af2c 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 Tue Nov 29 15:00:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13058691 X-Patchwork-Delegate: palmer@dabbelt.com 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 C489AC4167B for ; Tue, 29 Nov 2022 15:01:22 +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=X0Hs97I3dk+yZFfyuOe0lTnUZ6MP6u8VRwWUQq7P+X4=; b=DNaczkQHxmUJ1D r5w2tIZ4yr/5SUqfPw96ifQxgzUd2zcd2xlO02LLsiB50VeTkTadtU/EaTHEamCe+EJ3djyyHpD2M KenSzH3K8UrlMNx3NF969SRERZmnPZfJ8g5lYjHnzoeV7ShbUhL0fV4Y3jK7UQyPwvOc/Wmiu3sDd edIGth3hVmE5M0yl0Vtz+KVxBA9wVJX7n3S9Jyd/ZMe4uoZXkin5hBgjM5vAWxfwcYSb1w3srGBbS Z/cRIB+DTKy27jD98XZxWjhqhUxtAo7WMVspEDTGHIgCreCJWLSB3qm5CoVBSC294XACESUyTESA6 yhm+j0fUEszOkPeauU2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026j-009XAv-Au; Tue, 29 Nov 2022 15:01:13 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026W-009X4T-MA for linux-riscv@lists.infradead.org; Tue, 29 Nov 2022 15:01:02 +0000 Received: by mail-ej1-x634.google.com with SMTP id ha10so34500389ejb.3 for ; Tue, 29 Nov 2022 07:01:00 -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=45vMajD9uQw7DJBlJnq649nNKt2LRzKK21bL2UGoFbU=; b=CWNaeLXKYfhChhhmBLzBm3yP5Z+I7S3/9GB+BOOeGUtcyqZ9yMAaaCVtXYgtjyJLyZ m/xX3ZSqrNIzDJrHcIbW7k+DKDmGpVqJ9okpy9bra/ya1pq+5PYj0wZ19udrIcPnhDbP eQjjTzXdl2zV16uvkPROReHWX5sJNne5SqV1KsmkjYtRzTI4KPRe+0WST1KVbuLFMYPz bxyepF3IY6gPlQRM14lim7hpzMaoBckZvfiF2E9w9QgqkrJ4kIDeBvYYDFIQE6R1PWhW +UQC33kQCEh8eQih72uDNLfNRRhNa/5kf0n7yBlfgWdnGrwOOKAK9Zbe18xpCEEdUxcI M0Rg== 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=45vMajD9uQw7DJBlJnq649nNKt2LRzKK21bL2UGoFbU=; b=yguHIXQ7TlQ5rAhGx60Si0/epPz3xBHDmnHL7AgV0jk7iQl0Gt8Mu+hXhWS0QBD46L ktlIYmfSCmaZvHJxeHCZ/W+geoepIy10+QstNc75cNC6EKufTpmZeJiQwAHPHwg9nAzz VlK6wgGoo14jDPgIujLnjmp3VUiZhEKZNTEpCqTVUMQ+GrOg7dsRxYNSUqIiLdTFNODa oRweRwHabvRg5q13aB3gZa5IDK/Mrvzauxpj8qK4K0vEDakiA6zl8roGS3Dn9VKmBAyM WZ+d1DXD2AWwlYm4v6yPFhnBTAb1yvJ9juxFAXfXCxebBStoDGvQZOso9l/nIrLfX5dI i6lA== X-Gm-Message-State: ANoB5pl52X7O0iNicIdRoc4S6LvjMIRTvRIYgzasaxSb5oUY9sGl1SjU TYCAv28DcOEbRdkA038nRXc7RE/DccgBUw== X-Google-Smtp-Source: AA0mqf7Ppkky8sEIgnKbepBCRdJTKR/vIKo8H/Sr2xqUCIG/dYvqbAo8s0Tw+kpKhLdOPqoOxGnqzA== X-Received: by 2002:a17:906:1748:b0:7b2:7fa8:3d84 with SMTP id d8-20020a170906174800b007b27fa83d84mr6382813eje.650.1669734058643; Tue, 29 Nov 2022 07:00:58 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-748-2a9a-a2a6-1362.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:748:2a9a:a2a6:1362]) by smtp.gmail.com with ESMTPSA id de52-20020a1709069bf400b007ae566edb8bsm6271333ejc.73.2022.11.29.07.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 07:00:58 -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 v2 2/4] riscv: alternatives: Don't name unused macro parameters Date: Tue, 29 Nov 2022 16:00:51 +0100 Message-Id: <20221129150053.50464-3-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129150053.50464-1-ajones@ventanamicro.com> References: <20221129150053.50464-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_070100_737968_7021F164 X-CRM114-Status: UNSURE ( 9.64 ) 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 Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner --- 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 c7036166af2c..7cc2b587c5c4 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 Tue Nov 29 15:00:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13058692 X-Patchwork-Delegate: palmer@dabbelt.com 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 E7802C4167B for ; Tue, 29 Nov 2022 15:01:25 +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=wHXtQ4NwVVtON0ZVS7kZQZax3DlFvF++Ao7omejAcLA=; b=QBnYpiEY3lXVpq ukrjWorwC785AdHyp365C4zn7TLtPLMfZB8RaUzWNQbU46H4e+PCMTQgZn8yCmK5ApepI+7HosxdF KonCSh2/6oLgU4ILh3pUGRU9VWixU6p48YZowZlHYMEGh3zG6KNXJlbosHIvvlWEJjPoANPwBNRxV UMRPG1/IRrv2IqQonIPMF7SsUOw4LPw7DHyFEVh5OldR6Q8SAR+FgGPAwyhP0PdMyKaQrTafFjqBw AzkRZlYRiILFC1UtrkCJyIDoILtSBXiJoPCPwwMfUQh9fYz+ZzfEzGsfjydJHvcr8AHduN+gkJGOD XdBjNJDOEVD43gDhePEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026l-009XBt-O3; Tue, 29 Nov 2022 15:01:15 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026a-009X6S-10 for linux-riscv@lists.infradead.org; Tue, 29 Nov 2022 15:01:08 +0000 Received: by mail-ed1-x52a.google.com with SMTP id z20so20119958edc.13 for ; Tue, 29 Nov 2022 07:01:03 -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=1EMN9nLJtpNP8XdcPCCr5yWeGEoC+YU8jIuBg19r28s=; b=PMmj9DH+HHdKIXTMzDGD2sVcHi6w30rM5go+Pky+saIscSNLSXnc8aTIStNePY6lnP yn8TfVbfsvYY2L0hIEWiAz24EXMsPIcMPJAeMzXu30RDmJAEQeFG3XH5qujXkukLfyZH IJqYcRBM/vU+kkBcpbHWOeKPR/RfYP3p2QdZjIqNSO05v+SHxaAriqscaJa/JevxpD9F Ej4dDDDHM178u4XMzTjWNO1QjgQnGwEIf7ioF2uYu4ZYegNv7tdc3tXPIW4aeDCaoWRL BXIrv+lPi6sjuT/zNtVPy6unMXpaOR/EThVQdVhAOpq9t+O8jEpFCp5s0t7XmVPWIoh4 VLrQ== 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=1EMN9nLJtpNP8XdcPCCr5yWeGEoC+YU8jIuBg19r28s=; b=LCMMTmW60ejNUkcw7ponYxBvEoPEY9tz383OHSs0IwB1E+6tiMLXILKxBEPixl7QLx H7WMOj7NH7UEtAHiaw/5xpjQMAXHAe0k6120clMStiWGfm3sL3SqdWLZmw5AtSA42acd UW/MMomBWelBkSN4pk5hbbX8XYmoDz7XC3lz1agA5PG9Ra1nuSFQFhW9738jmNYhwdVt NlD5H6dcPZP49SSXeOA3UC2mjWfu8kiBTW3IXiGGET3R8hrEP1zJA5oM/6Vi5duWbw5m cdhv0yfcePXjuBXKrup1OuYU/kxkuJN0VjaH226FMg+Yn8KKZpgu1xiqn2T2Pn1a64Zu JDUg== X-Gm-Message-State: ANoB5pmbBAI4jDGP+SOPafdQ1MBTlyEaxv861lA2GkUhv9Za7Ywmrxms iTfDxErfwesDcC19P+fh1cRQwEGeREJGYw== X-Google-Smtp-Source: AA0mqf4TW3rK5NGGp1BoXVho97ipVNZsXYB+KA9lsNpttmWkE5jrne7Z1/Pljfn+nMVIt0lRKFw53Q== X-Received: by 2002:aa7:d417:0:b0:46b:203:f389 with SMTP id z23-20020aa7d417000000b0046b0203f389mr12835222edq.303.1669734060102; Tue, 29 Nov 2022 07:01:00 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-748-2a9a-a2a6-1362.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:748:2a9a:a2a6:1362]) by smtp.gmail.com with ESMTPSA id de52-20020a1709069bf400b007ae566edb8bsm6271362ejc.73.2022.11.29.07.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 07:00:59 -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 v2 3/4] riscv: alternatives: Drop the underscores from the assembly macro names Date: Tue, 29 Nov 2022 16:00:52 +0100 Message-Id: <20221129150053.50464-4-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129150053.50464-1-ajones@ventanamicro.com> References: <20221129150053.50464-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_070106_323444_C17E6104 X-CRM114-Status: GOOD ( 11.30 ) 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 Tested-by: Heiko Stuebner --- 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 7cc2b587c5c4..9ea95331a280 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 Tue Nov 29 15:00:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 13058693 X-Patchwork-Delegate: palmer@dabbelt.com 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 A24FDC4167B for ; Tue, 29 Nov 2022 15:01:28 +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=4rrsZH0E/V0swvd4Vh7RanKgC0jPYyEcAWi4N1Ka8zA=; b=lE43qI43ftkqkH 98LjZgH7hByTmXLSq31CMm/y4iwQK12uLAbm3RkIzUYH3nqg5K8iN3JgLjUmJpwNYnpfmtvaZVZVS B+Z7VUbhSRWs8yoezJrVaAoZf26Y0J7VUYt/Qc9djTXBXMB9uBuwCMzyW+Wa/NoiFr5xxBi9dFuYT YeZqGJEzsLe9OKwtNh41YG93ERKLyGuXzLI8QTRn7v79CO+CtOaVFoB+y9Av3vJHFYydjz0FzUUFi Bwb2pgjDRt3KnV8iptHUwwoox5y7v3Tw1T1jVfDR6uzt5wTk0Pd2TwEr9utcO7atDXmrnDWebPCWW 1Z/R/cp3pdsiso5cWZ/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p026q-009XFz-Ky; Tue, 29 Nov 2022 15:01:20 +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 1p026a-009X6L-S3 for linux-riscv@lists.infradead.org; Tue, 29 Nov 2022 15:01:08 +0000 Received: by mail-ej1-x629.google.com with SMTP id b2so18161948eja.7 for ; Tue, 29 Nov 2022 07:01:03 -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=AhLl7r1HGVU7YRWytAeW1LwK6+bVBtwP1ln3M6k7lLA=; b=b/81PVYn2t7vHOYF0Vp2UZPuyzjg/ZaU/78otRm5yU7bvcoh7wCjc6l4JQy/NbohRS t8JvrVOnzqEAOzA/YVNHgP7yWVBIp77LdO1BLGNcWgsXpfFYZqC0z9aeL3+OIPhIW65N V/ABLlKGuzDWipRQ96gOKwziHqiN05uwFatKZemXbEC++hwvaTbuUfl2N1X6oJJTB3BY RCjUt9CFPbJ/pz8HUoeOiIhBP+GF82cYNoJdjwZo5wJEhW+8x4GJj13ubB9n7R6/jAfi TTqvA7pCAPfrhfzkZrsjFdHvi6iFvT0KSNdl95dgvCZnVXuxT8OAH1go9jJ/vr+/0hCs 87oA== 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=AhLl7r1HGVU7YRWytAeW1LwK6+bVBtwP1ln3M6k7lLA=; b=vuVqf1MHd6FB5QsOjLebiTPyX0NrQkQey7iy2m1TCQnctO/Sq2yWVUjq2adE4WgkH4 gEp7S3x//ct7yfZkOt85h210ZigzzDUuBk8jhZHxZcc/UFhrc6qjsRVuLXdap9cSpzuf ORzD0vQ9fEKmh+K7s3h9BnHE4EMURDq4Eqr30jAzfKUKpFHe1yCFLxQcLLngU4DXV9P6 sKJGLsDqFS4TjSOgKIE29O9woPVecbCA7z3xL04rfF+V+Qx6xUXvi3fD7QAGEBVdz9N0 V36aT6XBq+qNX+wOvpQ3j1/AVT6N4FDEglROfeekboZWP5ov5gGxjC7LBw/qmybHnluF imNg== X-Gm-Message-State: ANoB5pmgY4/PR6dfyWW9M9yvy8ND3GdJbsszu6OrtJAZAW5fRdD2HAaL ntFooBEpmog2k9pWH7HE46IPNnnfOpWnpQ== X-Google-Smtp-Source: AA0mqf47AKOUr4JSVaF0zMfFekOXN+dfs2svk6G6FSL+8YruCbEKgOZ9hWC8pWb2WpkJkICfB1XHkA== X-Received: by 2002:a17:906:65c4:b0:7ad:d250:b907 with SMTP id z4-20020a17090665c400b007add250b907mr47958486ejn.737.1669734061718; Tue, 29 Nov 2022 07:01:01 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-748-2a9a-a2a6-1362.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:748:2a9a:a2a6:1362]) by smtp.gmail.com with ESMTPSA id p35-20020a056402502300b00463b9d47e1fsm6301162eda.71.2022.11.29.07.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 07:01:01 -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 v2 4/4] riscv: Don't duplicate _ALTERNATIVE_CFG* macros Date: Tue, 29 Nov 2022 16:00:53 +0100 Message-Id: <20221129150053.50464-5-ajones@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129150053.50464-1-ajones@ventanamicro.com> References: <20221129150053.50464-1-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_070106_281664_06EEA4D2 X-CRM114-Status: UNSURE ( 9.91 ) 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 Tested-by: Heiko Stuebner --- 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 9ea95331a280..7226e2462584 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