Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1492810rda; Mon, 23 Oct 2023 14:29:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZe5g4O1/02xk6BPyBMequqWjoF+AwhlrkZwHtKY+DuiX16UsRLM+omL5ifm/n93mzhinh X-Received: by 2002:aa7:900b:0:b0:692:6417:728a with SMTP id m11-20020aa7900b000000b006926417728amr16649840pfo.14.1698096562683; Mon, 23 Oct 2023 14:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698096562; cv=none; d=google.com; s=arc-20160816; b=Jm+oZa89c6NoAGBLa16DX+T4Z3Thd8DOJwOsKoxxRE9qFC+/7B9FAloLNHHNgW1ZpI NkQJFjViWi4QPdSZoXf5JPVSnTVmXSoOkMIbLaeGqE9H9V0WgQBEkifuB09DnQ2T54bR kbLPi7TltWSEJ8gR9v9Sxl9CzR2+b0oMtD3YNhixXVXLspw4qFu0XloWjirKtfs+TjBl jQOw1xF7EQ2MwBajxPMec/0hq2sTCKrRQ7lpmXaqVWDiW4HtmDdqpxkVRc8GioXBm+bI LXWgpN4Pu3FtPQMF+Y/CPq4E3HSw2rTvAEiCy7tfhyslWU/AR0ed4/dwRgxZ7ZdvLS0O EyhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZhjxUrT7ActbgiD9MJ/0J4Uyj55UgMInYRT8SxjqdOs=; fh=HP0u6UTDta/+GqBM4mahf5Lc0EVr0KtIYijFiIYMcHg=; b=QPKr8EyW+Dblzxyn4Zq+Tw9Hn4bFueXOD3NWOj3XJpq9iRFZl7GRBGFpPlKo1NQCAF SbalLytNaZDOBia2rcrhXgFfUTuJOuAllhq1K3FNxuk3nsZ1ER0NRDPKZrR0JjYBHnrn pbZ2F1/k63NOYeDnBdSkXpm216amnepI3MuK0qqHOIkD4TYdoAObS7Oq3/eclcwoPsMi zGhYL/01gsXGS8sLFksO2yJCpyGuyQm+Fbe1/f5Oym4eqjS+1EHHx8HAfxzoNQY3wfLK JUuX/xSdMjV84hEKNDwxHaeEll6kzMFslbLhq+Ku/SOQ0NBmSRsxCuf4XaQC4T9n6Z88 bd0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=LNh34dCR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i129-20020a639d87000000b00585ad175170si7090783pgd.69.2023.10.23.14.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 14:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=LNh34dCR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C540B80C0363; Mon, 23 Oct 2023 14:29:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbjJWV3R (ORCPT + 99 others); Mon, 23 Oct 2023 17:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjJWV3Q (ORCPT ); Mon, 23 Oct 2023 17:29:16 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 707A097; Mon, 23 Oct 2023 14:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ZhjxUrT7ActbgiD9MJ/0J4Uyj55UgMInYRT8SxjqdOs=; b=LNh34dCRqWx9h3oSXcJ5/QXkAf ybmB7vgbVZJ+eIP0hwZIsQaNuzsAmJS1OFLuo3ll3Le0uUIW1zkgLnUb7rbZf3TfUvVzEnDRfDfEc EwsKbLHs7ZGXVR7QwhN6NGRZfkYsLmG0AnxsMd4QOTtcK8qtxcAkhRqc1BvHW3KeYnP0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qv2Tq-00011F-7W; Mon, 23 Oct 2023 23:28:58 +0200 Date: Mon, 23 Oct 2023 23:28:58 +0200 From: Andrew Lunn To: Parthiban Veerasooran Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, steen.hegelund@microchip.com, rdunlap@infradead.org, horms@kernel.org, casper.casan@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, horatiu.vultur@microchip.com, Woojung.Huh@microchip.com, Nicolas.Ferre@microchip.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com Subject: Re: [PATCH net-next v2 1/9] net: ethernet: implement OPEN Alliance control transaction interface Message-ID: References: <20231023154649.45931-1-Parthiban.Veerasooran@microchip.com> <20231023154649.45931-2-Parthiban.Veerasooran@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231023154649.45931-2-Parthiban.Veerasooran@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 14:29:21 -0700 (PDT) > +static void oa_tc6_prepare_ctrl_buf(struct oa_tc6 *tc6, u32 addr, u32 val[], > + u8 len, bool wnr, u8 *buf, bool prote) One of the comments i made last time was that wnr is not obvious. I assume it means write-not-read. So why not just write? Since it a boolean, i assume war is never needed, so !wnr cal always be considered rnw. And prote could well be protect, the two extra characters make it a lot more obvious. Or better still. > +{ > + u32 hdr; > + > + /* Prepare the control header with the required details */ > + hdr = FIELD_PREP(CTRL_HDR_DNC, 0) | > + FIELD_PREP(CTRL_HDR_WNR, wnr) | > + FIELD_PREP(CTRL_HDR_AID, 0) | > + FIELD_PREP(CTRL_HDR_MMS, addr >> 16) | > + FIELD_PREP(CTRL_HDR_ADDR, addr) | > + FIELD_PREP(CTRL_HDR_LEN, len - 1); > + hdr |= FIELD_PREP(CTRL_HDR_P, oa_tc6_get_parity(hdr)); > + *(__be32 *)buf = cpu_to_be32(hdr); > + > + if (wnr) { > + for (u8 i = 0; i < len; i++) { > + u16 pos; > + > + if (!prote) { nitpick, but please use positive logic. Do the protected case first. Andrew