[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ea021ae-1284-4519-e467-5c03bc62c98b@huawei.com>
Date: Tue, 5 Jun 2018 17:28:32 +0800
From: Yisheng Xie <xieyisheng1@...wei.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
USB <linux-usb@...r.kernel.org>, Felipe Balbi <balbi@...nel.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 01/21] usb: phy: use match_string() helper
On 2018/6/1 2:59, Andy Shevchenko wrote:
> On Thu, May 31, 2018 at 9:56 PM, Sergei Shtylyov
> <sergei.shtylyov@...entembedded.com> wrote:
>> On 05/31/2018 09:47 PM, Andy Shevchenko wrote:
>
>>>>> - int err, i;
>
>>>>> + err = match_string(usbphy_modes, ARRAY_SIZE(usbphy_modes), phy_type);
>>>>> + if (err < 0)
>>>>
>>>> This is one of the few cases when 'err' is not the best name for such a
>>>> variable. I'd prefer to see something like 'match' or even 'rc' or 'ret'... :-)
>>>
>>> Then leaving i would make it?
>> Yes. :-)
>
> So, I leave it to Greg to decide either it's okay in this version, or
> needs update with i left untouched.
Hi Greg,
IIRC, you seems want to keep the err unchanged, right?
Please let me know if another version is need.
Thanks
Yisheng
>
>>> I'm okay with either which just not renames err, b/c it's used with
>>> something else in this function.
>>
>> Looking at it again, 'err' seems equally bad for the result of
>> of_property_read_string()... unless the check there is changed to just *if* (err) --
>> this function never returns positive values, 0 means success, others mean error.
>
> While you seems right, this is matter of another change which you are
> welcome to propose.
>
Powered by blists - more mailing lists