lkml.org 
[lkml]   [2023]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/6] usb: cdns3-ti: move reg writes from probe into an init_hw helper
From


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

\
 
 \ /
  Last update: 2023-11-20 14:01    [W:0.086 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site