lkml.org 
[lkml]   [2020]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch V3 12/18] usb: gadget: tegra-xudc: support multiple device modes
From
Date


On 28-01-2020 23:40, Thierry Reding wrote:
>> struct tegra_xudc_save_regs saved_regs;
>> bool suspended;
>> bool powergated;
>>
>> - struct usb_phy *usbphy;
>> + struct usb_phy **usbphy;
>> + int current_phy_index;
> Can be unsigned int. It's also very long. It might be better to choose a
> shorter name so that when you use it, the lines don't get excessively
> long. Alternatively you could keep this field name and instead declare
> local variables to reference the current PHY to make lines shorter.
>
> Actually, looking at this a bit more, I don't see current_phy_index ever
> used by itself (other than the assignment and one check to see if a PHY
> has been selected). So why not just store a pointer to the current PHY
> and avoid all the dereferencing?
>
> Thierry

current_phy_index main purpose is to quickly get which index for USB 2
and 3 phy's to be used. This is used at mulitple functions. Based on
your comment above, I believe its good to use 2 pointers for UTMI and
USB 3 phy's, which are points to current phy index. This ensures to keep
line length as less as possible.

Thanks,
Nagarjuna

\
 
 \ /
  Last update: 2020-01-29 07:48    [W:0.431 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site