From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 778C52EAFE; Thu, 16 Nov 2023 12:01:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SuKBqNHs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005A4C433C8; Thu, 16 Nov 2023 12:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700136076; bh=c7gMUttZFyHHQ9COrEEKH4SS+vncMf6Y8hrZnTRxLYg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SuKBqNHsU+fNNgXSXPII1Osj2l1CDoO4VvhdYjyiNcPr/CKLB8/IgHL+sH2Zi5Vd3 OF9GVwgC+Iz1tDkjBPH05TP8xf9cUZvJP27FLs6guK6hcXe+QitVEfeRxycjlrlUHC bB0J7i4JVzw0lbczlYUP1gxsDzeA4QFkt0zl2iuQr1J21UAka2f35Gl0hUARiLxa8d LRMyXZY1B/HP7oyspTrzBF36zEYurikArcAf6C6+ObpTdJRrqhbO5h4zkkhfRV5Xri asFvYLhnhuQaawuRRVLPA38RvdGCETNY6o1wTdnNgYHD8D/fYTKPAmFnROS/p3Z/iZ Rt8ZgxgcGVmMg== Message-ID: <79f3beef-1afe-4b97-8f6e-435c0419b513@kernel.org> Date: Thu, 16 Nov 2023 14:00:46 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/6] usb: cdns3-ti: move reg writes from probe into an init_hw helper To: =?UTF-8?Q?Th=C3=A9o_Lebrun?= , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20231113-j7200-usb-suspend-v1-0-ad1ee714835c@bootlin.com> <20231113-j7200-usb-suspend-v1-2-ad1ee714835c@bootlin.com> Content-Language: en-US From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 15/11/2023 16:23, Théo Lebrun wrote: > Hello, > > On Wed Nov 15, 2023 at 12:33 PM CET, Roger Quadros wrote: >>> --- a/drivers/usb/cdns3/cdns3-ti.c >>> +++ b/drivers/usb/cdns3/cdns3-ti.c > > [...] > >>> static int cdns_ti_probe(struct platform_device *pdev) >>> { >>> struct device *dev = &pdev->dev; >>> struct device_node *node = pdev->dev.of_node; >>> struct cdns_ti *data; >>> - int error; >>> - u32 reg; >>> - int rate_code, i; >>> unsigned long rate; >>> + int error, i; >> >> Should we leave rate_code and get rid of i? > > I see your point about i being usually a temp variable. Using rate_code > instead of i means the for-loop becomes rather long (column 87) & > should ideally be split. > > How about moving the data->usb2_refclk_rate_code assignment up, closer > to the computation of i? That way we don't reference i three blocks > down the road, seemingly out of nowhere. That is much better. Thanks! -- cheers, -roger