Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1161224rdb; Fri, 16 Feb 2024 07:10:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXC8pKUHjz6J3oyEOgWIRzr5W+37UqgXOVwelNQVmFK1ykQyXA7ZdVCoygfAEtItN2XHch6vGA7oeSHTlXLqXgpSBleZmPhzOa5Cbdjpg== X-Google-Smtp-Source: AGHT+IFd2j1hherX6FwLE0u65nEEWnVnPWJUmkfVXutRAVpI+SmkgkN+LjEOsVduhAcj2S5398E3 X-Received: by 2002:a05:6a21:3115:b0:19e:a1ae:7a95 with SMTP id yz21-20020a056a21311500b0019ea1ae7a95mr5131128pzb.47.1708096215162; Fri, 16 Feb 2024 07:10:15 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id cm22-20020a056a020a1600b005dc864bb6e6si5091pgb.634.2024.02.16.07.10.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:10:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68777-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-68777-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7EC46B22343 for ; Fri, 16 Feb 2024 15:04:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6133412F39F; Fri, 16 Feb 2024 15:03:51 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 592A612C804; Fri, 16 Feb 2024 15:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095830; cv=none; b=mbPn4+vRaw3O+bIb4a3nypsuYAzAgdRewUS40l6L0/dzkZnUbiO8BEIeu7sKCzezuqpRcKSIvvG/Ac5H5MOPow1haoFpymzsa0gMXJkwpphMSAPo1FZqQhK+ltbJ8kaK84pvvFXqVuYR4ftkFHPRZTNLWRrF61BX5NvK5Nxo5IE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095830; c=relaxed/simple; bh=RgHw/+iDCLN4Sq5edIix0ZU/8P/azdKYkrO41Y2oW4A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ok0VF0aYiKKxGrSIuDRb7tufVS1imlX7W/MC65AtUzwYEM+pkI+GQwJ/L97GRtXBwMIp6NfTD87P7yCDjTUBpgHCFbczUnGuaGCj2ecns+p/l1n2brhjjSrwntbafSDHjxK6v8pErAqZBesdgz/JoVjevBaZogT+iwKGrWbGGHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10985"; a="2337586" X-IronPort-AV: E=Sophos;i="6.06,164,1705392000"; d="scan'208";a="2337586" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 07:03:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10985"; a="912373712" X-IronPort-AV: E=Sophos;i="6.06,164,1705392000"; d="scan'208";a="912373712" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 07:03:41 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1razkY-000000054p0-1409; Fri, 16 Feb 2024 17:03:38 +0200 Date: Fri, 16 Feb 2024 17:03:37 +0200 From: Andy Shevchenko To: Siddharth Vadapalli Cc: Vinod Koul , Thomas Richard , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com Subject: Re: [PATCH v3 08/18] phy: ti: phy-j721e-wiz: split wiz_clock_init() function Message-ID: References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> <20240102-j7200-pcie-s2r-v3-8-5c2e4a3fac1f@bootlin.com> <14429802-b4d8-4a3e-88ea-a9fc55d2251c@ti.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: <14429802-b4d8-4a3e-88ea-a9fc55d2251c@ti.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Feb 16, 2024 at 02:34:39PM +0530, Siddharth Vadapalli wrote: > On 24/02/16 11:32AM, Vinod Koul wrote: > > On 15-02-24, 17:43, Andy Shevchenko wrote: > > > On Thu, Feb 15, 2024 at 04:17:53PM +0100, Thomas Richard wrote: .. > > > (Side note, as this can be done later) > > > > > > > if (rate >= 100000000) > > > > > > > + if (rate >= 100000000) > > > > > > > + if (rate >= 100000000) > > > > > > I would make local definition and use it, we may get the global one as there > > > are users. > > > > > > #define HZ_PER_GHZ 1000000000UL > > > > Better to define as: > > #define HZ_PER_GHZ 1 * GIGA > > The variable "rate" is being compared against 100 MHz and not 1 GHz. Extremely good point why constant definitions are better (to avoid missing or extra 0, etc)! > The driver already has the following macros defined: > #define REF_CLK_19_2MHZ 19200000 > #define REF_CLK_25MHZ 25000000 > #define REF_CLK_100MHZ 100000000 > #define REF_CLK_156_25MHZ 156250000 > > So would it be acceptable to change it to: > if (rate >= REF_CLK_100MHZ) > instead? Sounds like a good idea to me. -- With Best Regards, Andy Shevchenko