linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Yisheng Xie <xieyisheng1@huawei.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	USB <linux-usb@vger.kernel.org>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [v2,01/21] usb: phy: use match_string() helper
Date: Thu, 31 May 2018 21:59:16 +0300	[thread overview]
Message-ID: <CAHp75VfUvcCJEyisNG0cgiL8GCdNQvSaefJVW2yx7HWDHC45cw@mail.gmail.com> (raw)

On Thu, May 31, 2018 at 9:56 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.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.

>> 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.

             reply	other threads:[~2018-05-31 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 18:59 Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-05  9:28 [v2,01/21] usb: phy: use match_string() helper Xie Yisheng
2018-05-31 18:56 Sergei Shtylyov
2018-05-31 18:47 Andy Shevchenko
2018-05-31 16:55 Sergei Shtylyov
2018-05-31 11:11 Xie Yisheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75VfUvcCJEyisNG0cgiL8GCdNQvSaefJVW2yx7HWDHC45cw@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=xieyisheng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).