Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp551688lqi; Thu, 7 Mar 2024 05:23:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9cyQLvWtIQNEXneZ1hoMuU5cn7zS0u/kvutkR+QQTAccn1CQD58J1WSU/ghZg3HPDn/KMdY5SaU3D0b5CBC9jdFDd3QDwACMhOA3mgw== X-Google-Smtp-Source: AGHT+IGuoQntzD1QmQYcmt7UaMeIAREzi+4nWvWXUhTnWjHSelU/FBj5aZ4ZWSwOMWTut73fdEcE X-Received: by 2002:aca:1705:0:b0:3c1:c93d:b3af with SMTP id j5-20020aca1705000000b003c1c93db3afmr7151356oii.20.1709817789125; Thu, 07 Mar 2024 05:23:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709817789; cv=pass; d=google.com; s=arc-20160816; b=XeeYu0JfBItSAAqUUSM6VdJbh8bmqjwlwAzNNIv1cneq9GoFBBRjkhWOMrey9W1Iiw SL4KPA+jEytY33w2RWSrr9NebuUHgry+Xk8rs3D4RfYwrhFjNfw+A3HseYw5uBmE9SCp vOoOmu6+Hqq4Y9+oei6E44uXAE7PzjpCCLE6e5PP0udcNol4Lwtr2J9wTgBzvkN+ZJEy Jnq0xnLbrB1Wg9gvXyHLBsKrDsdDxqvGlOi/uYVFEMcGd9htVveMKC/suHabyM9pZ+aO 37np3oGL5IFg+wAbnll/x7OKU5sFWDwTVsSSs0H0Fca5t2QxXZJW3JtMpYQ93VO1QT0F t1QQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2adjiSztGzfYM9T4lx+mXU7akcr/eZ53zqRB/d3naCg=; fh=+bZdVkiLmz24uXoRZ/h+BNAr4vk9JBC6QsMoFH7X5YA=; b=PVXYkp5TuMIA2BIE/wXUx2INS0+8SS87qM3E3zWZmguU+d/O5RTpm/UzqVyy4UOOZA XQ2ST/isQAkevDNUrseuvyIuKXO2jZxOfRRnGRSvLhmfdXs77FPDoO1zJu0EiW4s3OoP wPO1RFhM8sXHS2um/2Exdzu6A9vzJInREjP1pIJpBKcELbjOpNL+zYDL1iq+s4eMhwJX jdhLV/d4erxUl/twGm0kAX8W1Y1+SwTnJFMpcqfdCP+PypfOFbw/m5dG6nSa1Jgr3tEX lPVpT2GoguuDdv1w7c3SE8wlyXeq5K+GW+B5qy/rd5ujQLT3TxL518kP2jfUBhoT28dE LMGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=NS0qDYMY; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-95588-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i4-20020a63e444000000b005dc4202b402si13985058pgk.173.2024.03.07.05.23.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:23:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95588-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=NS0qDYMY; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-95588-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 658FD282356 for ; Thu, 7 Mar 2024 13:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE62E12C7F4; Thu, 7 Mar 2024 13:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="NS0qDYMY" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0509A129A98; Thu, 7 Mar 2024 13:22:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709817726; cv=none; b=ndl2XnXnMczd09DEBS2G8zcTXojNIPd4JCMvRaRIDUMPPw/jv0cIrD64gtbMtpkK8fGWE1Gei9mIbDGtWckrqytq1pJekuHM0N721G2BkTsC1z5MH/JxBX7WK4S+LSrIAmYdE6fk8gtBBPWUGvThmMo2aXU9SbC9NWf3LctuH1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709817726; c=relaxed/simple; bh=w2MkkM7a8PG5sSCI7iTEMgtD4tpClgb1lVwK2p69wa0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gRopV+l9UhaFto6Fs+VsjY8tQC+5HMEBatY8l5QzO0Y4lJww0Y2GZ+iktO62VPc9RcFU2rKrPZX4grQtZo5fMGgykyo1WwNhrfw/GFz+cy+7WfhKnjBWRv1iOCjcWhX/W+yUEyDymVk6YL2rOcEMf4/CE2O+xS0oP49a44EjWz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=NS0qDYMY; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=2adjiSztGzfYM9T4lx+mXU7akcr/eZ53zqRB/d3naCg=; b=NS0qDYMYyfSg/DYyBW0xzZV6ke O5nAjui8RFwzJMoYUkx/9X+X1rylXwKUHbQF1h1POAX8BoZEODQnlVDeKWQo53ajra4vj97Rt7eXD kqB4a0NOvWQdq1Ihs2tuNw9oVYkEBYLlVr9OiOjB7ZAFLQgYqRFd6cPn30NZWNi5m16M=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1riDhR-009aTZ-0R; Thu, 07 Mar 2024 14:22:17 +0100 Date: Thu, 7 Mar 2024 14:22:16 +0100 From: Andrew Lunn To: Parthiban.Veerasooran@microchip.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, saeedm@nvidia.com, anthony.l.nguyen@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, Horatiu.Vultur@microchip.com, ruanjinjie@huawei.com, Steen.Hegelund@microchip.com, vladimir.oltean@nxp.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com, Pier.Beruto@onsemi.com, Selvamani.Rajagopal@onsemi.com, Nicolas.Ferre@microchip.com, benjamin.bigler@bernformulastudent.ch Subject: Re: [PATCH net-next v3 03/12] net: ethernet: oa_tc6: implement register read operation Message-ID: References: <20240306085017.21731-1-Parthiban.Veerasooran@microchip.com> <20240306085017.21731-4-Parthiban.Veerasooran@microchip.com> <48b65759-6e69-46ef-a2ed-857d04eadac8@lunn.ch> <83e0b340-521e-4d60-90bb-92d2ca6f5abe@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83e0b340-521e-4d60-90bb-92d2ca6f5abe@microchip.com> On Thu, Mar 07, 2024 at 07:04:20AM +0000, Parthiban.Veerasooran@microchip.com wrote: > Hi Andrew, > > On 07/03/24 5:49 am, Andrew Lunn wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > >> enum oa_tc6_register_op { > >> + OA_TC6_CTRL_REG_READ = 0, > >> OA_TC6_CTRL_REG_WRITE = 1, > >> }; > > > > I thought it looked a little odd when the enum was added in the > > previous patch with the first value of 1, and only one value. Now it > > makes more sense. > Ok. > > > > The actual value appears to not matter? It is always > > > >> + if (reg_op == OA_TC6_CTRL_REG_WRITE) > > > > So i would drop the numbering, and leave it to the compiler. The > > patches will then look less odd. > "drop the numbering", do you refer to this patch alone or previous patch > also? If it is for this patch alone then it makes sense as they are > going to be 0 and 1 anyway. But if we drop the numbering in the previous > patch it will become 0 which will create an issue in the below line as > it needs 1, > > FIELD_PREP(OA_TC6_CTRL_HEADER_WRITE, reg_op) That is why i asked: > The actual value appears to not matter? It is always > > + if (reg_op == OA_TC6_CTRL_REG_WRITE) So the actual value does matter, so keep it in the previous patch. Does the value of OA_TC6_CTRL_REG_READ matter? Is it also used in FIELD_PREP etc? If not, taking away the = 0 will emphasise that OA_TC6_CTRL_REG_WRITE has to be 1. Andrew