Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9461406rwb; Thu, 24 Nov 2022 13:22:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf70m/RPlcBqcAyqkdqvy9t1pF34K1BcVR8rJ2XkGsvhbp2WR3ICq5KQQywBQX/t1aD1BL6d X-Received: by 2002:a17:906:6d88:b0:7ad:b86b:3ff with SMTP id h8-20020a1709066d8800b007adb86b03ffmr30479312ejt.448.1669324920520; Thu, 24 Nov 2022 13:22:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669324920; cv=none; d=google.com; s=arc-20160816; b=WfJQYrMU9hGLJUN5uq1GNalK7h29LWBAkcgbOvo+gbVMPbAho20nzXhUywUQaPNVWE 5TCxhqrlE0ihCHS7RjH1eH0GmRlKqKJvK9rwM1430XkrLvaE6VPLKSUqoDO3VCpZMLXg 3v07g/sZ6jnIo2z1KHfQdrIaZ4+dCw+pwCt8dnqqjumIo8Kv0Qd3BPH5mxeLesLFroyp Bq/80dXFCSHhbW0rhpmZIQ8wQQJCaC0u7pAM3d2LBzMotP6tdODArjPFED5PhPhTndTu NKm0v3G/6+GadeB5K95KlHWfn8q6F6p6BDTTTmCaxhsx4IoFyiHIfVBC5npjyIVPXUWH GD+A== 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; bh=e8yWwc/Y9Bxeyz4qKT+zedrfr5p/jK0jdhbalmQ6i+w=; b=wcD8MZ6SDvzHVFfgNoZQGo79OvSaLML0pWf1CBmDjny2jzJHO8E858UE0pIVANfWQL 1llwMM8FOJim2MK2ltJWfoeSbYDV/xWtAP+sN3jsaINLRy9CyaOLRZ+dBnfkp6R5Ye3g pGipGMUWAa48hsjvh6kyYjmy52CggwzRs6WK2WOM5x6BPMPgVo2jDWpbdMy13rV3CtXK /r2sZBhoe/4R395VbAi41nHUTqE1/ute7KYhnzTZTEZsehk9kuwbFrxmY34VitPWFNor AleOUX8QL4GkyUKgFP7AN2OhCHfSP6Thf9XbfAsnrNpjyQKNHIu3uoM3i6Or7Q9jqhzF I4yg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a170906974e00b0073d710fec77si1758827ejy.251.2022.11.24.13.21.36; Thu, 24 Nov 2022 13:22:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbiKXUon convert rfc822-to-8bit (ORCPT + 88 others); Thu, 24 Nov 2022 15:44:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiKXUol (ORCPT ); Thu, 24 Nov 2022 15:44:41 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1990281F9A; Thu, 24 Nov 2022 12:44:39 -0800 (PST) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oyJ59-0007px-11; Thu, 24 Nov 2022 21:44:27 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Conor Dooley , Conor Dooley Cc: Prabhakar , Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Magnus Damm , Rob Herring , Krzysztof Kozlowski , Guo Ren , Jisheng Zhang , Atish Patra , Anup Patel , Andrew Jones , Nathan Chancellor , Philipp Tomsich , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Biju Das , Lad Prabhakar Subject: Re: [PATCH v4 1/7] riscv: asm: alternative-macros: Introduce ALTERNATIVE_3() macro Date: Thu, 24 Nov 2022 21:44:25 +0100 Message-ID: <3307993.NgBsaNRSFp@diego> In-Reply-To: <59aea5e5-25f1-de8c-9982-5db226f8bda5@kernel.org> References: <20221124172207.153718-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <59aea5e5-25f1-de8c-9982-5db226f8bda5@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SPF_HELO_TEMPERROR 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 Am Donnerstag, 24. November 2022, 21:08:17 CET schrieb Conor Dooley: > On 24/11/2022 20:05, Conor Dooley wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > > On Thu, Nov 24, 2022 at 08:58:41PM +0100, Heiko St?bner wrote: > >> Am Donnerstag, 24. November 2022, 20:52:33 CET schrieb Conor Dooley: > >>> On Thu, Nov 24, 2022 at 05:22:01PM +0000, Prabhakar wrote: > >>>> From: Lad Prabhakar > >>>> > >>>> Introduce ALTERNATIVE_3() macro. > >>> > >>> Bit perfunctory I think! There's a lovely comment down below that would > >>> make for a better commit message if you were to yoink it. > >>> Content looks about what I'd expect to see though. > >> > >> Also both the comment on the original ALTERNATIVE_2 and the new ALTERNATIVE_3 > >> should probably be merged into a single comment explaining this once for all > >> ALTERNATIVE_x variants. > >> > >> Especially with the dma stuff, I'm pretty sure we'll get at least an ALTERNATIVE_4 > >> if not even more ;-) . So we defnitly don't want to repeat this multiple times. > > > > Oh I can promise you that there'll be a #4 ;) I do find the comment's > > wording to be quite odd though.. > > > >> + * 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 > > > > In particular this bit about "at the same location" does not make all > > that much sense. What "at the same location" means in this context > > should be expanded on imo. Effectively it boils down to someone else is > > already replacing the same things you want to replace - it's just the > > word "location" that might make sense if you're an old hand but not > > otherwise? > > Or maybe I am just biased because I tried to explain this to someone > recently and the language in the comments didn't make sense to them, > and anyone meddling with this code should be able to understand it? When I first looked at the whole alternatives / patching thing, the whole thing looked like dark magic to me ;-) . But yeah, the comment here, but also the original one above ALTERNATIVE_2 could use improvements to explain better what it tries to do. > >> + * this case, this vendor can create a new macro ALTERNATIVE_3() based > > > > Also, using the word "can". Is it not a "must" rather than a "can", > > since this stuff needs to be multiplatform? > > > >> + * on the following sample code and then replace ALTERNATIVE_2() with > >> + * ALTERNATIVE_3() to append its customized content. > > > > > >