Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2776449rwj; Mon, 19 Dec 2022 08:42:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7BqiXcTv7gDPq/yc9qLZ0TcLmpSMglnBeR7RYyXmYk4cs/e3L8N5Qrn599W6zf+It6USgc X-Received: by 2002:a17:902:bb8b:b0:185:4421:72cf with SMTP id m11-20020a170902bb8b00b00185442172cfmr42286096pls.20.1671468147973; Mon, 19 Dec 2022 08:42:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671468147; cv=none; d=google.com; s=arc-20160816; b=f7Hf1xX3XqEwRGTlPovBPwYwr1+m/aZ4KUSYY/oM4/ixZTE/HtkYZurfmKi72sVhy9 nS8M13GD/sCIoncQMn8gVifnSPdUieSNhsgpKtSsYU7SeA5PJb1MVmPWWILFBRFB8AHU +zH+QviY3PPDS9dCWgTQAIrSUQh8QC4E22mmpV4GNAqlnXU/ZkNp8wW2KLJTfk7SA+DJ 6jLVQt6mOIBMoTgK1caeT384eW5W+LnIBqbLTHnUPzbJmIm3sWjJ8aZg21D3WYSTUM3Y 0E4HArdfLFCRFuBwd1e7ZVJMkh1tIvWjGaFkzfLkCD1QHI7ann/mdNmB5hZQS3oAsqH5 DHAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OJ/xV5kYQm2Hd1j/xGG28n/3bJ/6B0VUoXU4GtRHvxQ=; b=fykUqM8i5y/hacHjfpKPYxvjjYR1zm/8UpCKmdSihEAskxdhH0rP47v6lDESr+Si5B NwXrADN/5C0uI1osr+MjtszFi12xJaG55ksyfDAX0Krs4m7L9zxTKXVYqcZE4/FAZvsg BM4oDGSQ1EYoibdltC5l8TH5z6XUofZ/Rhq8OaUvZ9njd07VO+jjLTgNd/nXqazoFLof gXD2qZRu0nOgA2DxXQYv8fXjB2qbg8WU2zs3bXRUm2V1LxsT7SaYyaHINEpxNXIi+Hv+ 8aE7BAnB2W6IwYKLUwv2TDhUbbT4PL3jK6SfpIEwp+UjawnkeLhCKdWINrvZoJNDBLBr bhLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gRCkCjzA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a170902f15400b0018919169bc4si10237906plb.430.2022.12.19.08.42.18; Mon, 19 Dec 2022 08:42:27 -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=@gmail.com header.s=20210112 header.b=gRCkCjzA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231458AbiLSQZO (ORCPT + 70 others); Mon, 19 Dec 2022 11:25:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbiLSQZI (ORCPT ); Mon, 19 Dec 2022 11:25:08 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9447A295; Mon, 19 Dec 2022 08:25:04 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id d20so13699033edn.0; Mon, 19 Dec 2022 08:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OJ/xV5kYQm2Hd1j/xGG28n/3bJ/6B0VUoXU4GtRHvxQ=; b=gRCkCjzAfQU2xDRo530vIc++qERe/p8Qa4h36hfPb032x+8B3EhQuF1VlIhvFm7yay Gt3angQhAw2o9dwLkK5Cmpu8Wi3i6MUfEVWdUqR1cohlACLZOOiLXNX/pt4eqnkmIdcJ VpPk7ifEtMfYYsU2/6IXuS2i7or0b4C4CvAQj5IB6WY6d+vcC7JKLFk0MuIuJ7GXmN2v eSoLeB0KL1oYwUhOQ7W5JdpkVLzJE62iHHQgVm4ezclp2R5PkYfsodKgJC+3Ddh1uzwc bopYe7yesuBFOVt8KYv1kcU7NRgOeaGykUbNrUrLiDlgb/vYH5m+vSXduN3Sj4gLyNr9 qMAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OJ/xV5kYQm2Hd1j/xGG28n/3bJ/6B0VUoXU4GtRHvxQ=; b=n/qyM9OAnLB0iWzIpY6bGVRwbpLRfPIZLdcUHhc7OwzchsLwSfk5ADhfMSyNXFv0qs 5M8FIr3rB5rMjgPaMPTT3P0veBxzgXegThdioQvLBAzctjEmOYsX8zDC+pppu0446UJH 4AlXQG6HLRVL/Z86E6fcmCsf4xmEdLNNf7OhsQk1i8pvAx3JYI7TfeXxYRJrSnDi4qRK n2oOHnXnexi/JR+OceluaU8czglVZM28zIW91TsuTTsN6lTN7avItTpT5cDfsLizjnZu 4BcnCxzuUvcCwWTewdGdMl3FX7qcurcI9h4vu5uYhecpPtz9c0OG//XlWmZ5YYsSNKCc 0afA== X-Gm-Message-State: ANoB5pn3QzvrZBKdQp81DakBR6fsdzE4wtTE3oS2PCXYLyladYGVZh3W j5+AX3HLsWJs01fKCYpRq+x3b4JqFIvE+9KmSMY= X-Received: by 2002:a05:6402:2987:b0:45c:a9d3:d535 with SMTP id eq7-20020a056402298700b0045ca9d3d535mr41995467edb.0.1671467103114; Mon, 19 Dec 2022 08:25:03 -0800 (PST) MIME-Version: 1.0 References: <20221212115505.36770-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20221212115505.36770-2-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: "Lad, Prabhakar" Date: Mon, 19 Dec 2022 16:24:36 +0000 Message-ID: Subject: Re: [PATCH v5 1/6] riscv: asm: alternative-macros: Introduce ALTERNATIVE_3() macro To: Conor Dooley Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Magnus Damm , Heiko Stuebner , Conor Dooley , Samuel Holland , Guo Ren , Rob Herring , Krzysztof Kozlowski , Jisheng Zhang , Atish Patra , Anup Patel , Andrew Jones , Nathan Chancellor , Philipp Tomsich , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Lad Prabhakar Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Hi Conor, On Mon, Dec 19, 2022 at 4:22 PM Conor Dooley wrote: > > On Mon, Dec 19, 2022 at 11:15:17AM +0000, Lad, Prabhakar wrote: > > > On Mon, Dec 12, 2022 at 11:55:00AM +0000, Prabhakar wrote: > > > > From: Lad Prabhakar > > > > > > > > Introduce ALTERNATIVE_3() macro. > > > > > > > > A vendor wants to replace an old_content, but another vendor has used > > > > ALTERNATIVE_2() to patch its customized content at the same location. > > > > In this case, this vendor can use macro ALTERNATIVE_3() and then replace > > > > ALTERNATIVE_2() with ALTERNATIVE_3() to append its customized content. > > > > > > > > While at it update comment above ALTERNATIVE_2() macro and make it generic > > > > so that the comment holds good for any new addition of ALTERNATIVE_X() > > > > macros. > > > > > > > > Signed-off-by: Lad Prabhakar > > > > > + * > > > > + * Usage: > > > > + * ALTERNATIVE_x(old_content, > > > > + * new_content1, vendor_id1, errata_id1, CONFIG_k1, > > > > + * new_content2, vendor_id2, errata_id2, CONFIG_k2, > > > > + * ... > > > > + * new_contentx, vendor_idx, errata_idx, CONFIG_kx) > > > > */ > > > > #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_3(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, \ > > > > + new_content_3, vendor_id_3, errata_id_3, CONFIG_k_3) \ > > > > + _ALTERNATIVE_CFG_3(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, \ > > > > + new_content_3, vendor_id_3, errata_id_3, CONFIG_k_3) > > > > > > btw, why is this indented with spaces when the line above it is indented > > > with tabs? (At least, that is how it appears in mutt). > > > > > I'll update it with spaces. > > The file uses tabs, so it'd be switching the spaces you added with tabs, > right? My bad that was a typo, I meant tabs :p Cheers, Prabhakar