Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp672691imm; Tue, 5 Jun 2018 02:30:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFbsH1/EuLAW+z+0suvfTwTgkAqjnK+hhsX+d6gi4RMDJ4fkdVd4KNIcNqkuVDZHIuaiIo X-Received: by 2002:a62:e506:: with SMTP id n6-v6mr1299985pff.125.1528191013285; Tue, 05 Jun 2018 02:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528191013; cv=none; d=google.com; s=arc-20160816; b=WeCb9q27FzaiIIWbncgPvb1zwwobWMz7/FkZOkLmerCg68PiCiutONRiZQIk7Pjm8E mJ7X4FguLi1z96WF13u5T5ytNQpKCZbJCiO4IUZ8u4XSkA9/BMc0hgDnVktbOzSOA9JS Zf0NMEMsOqjARj/awU306YB61jFsuCp2eIXI0EEZPcdWur15XrxRi/rigUCDRqL3ReMo lTxwPZ//r9a5J/XPgqkOQd/bhXUUPyvlx5634//3UjPxJqg5v96fDzf8NBvYjdGeUctQ pHaw/mxZ42XtaQ9NyEB44f6PEso+VOLwouO1Cm08vmdhBs6BPKOT+OPNwfbOz4F7ATF/ P+tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=q12BkXktT6fu8Fn9x7yFSp4mS3TDdu1dSShLuDHsc+A=; b=vCTPyUNZ2O9ZHUb8dT8b/XWw/pWynRzc8tkx53zb5KtYT1zLul/bHE7rwT7righP3j GKWFs7veQJ9I8SPRUTPRFWntxpUxwm8VGTJwSGbCqeRns5jEjqykMpWyPa6qqhqFuu/Z f3fVsM+QKfiHr1xM5iMH4EoZZWzLwD/MccVwbsc7VZ+4sVQQPuyPZU3/HjeEWmEP6347 E9nO54O1wqt8giG/9ZY0Worts7Z7+Z6sybGboieE5n5LtKhaqAw1jpzO0fceztghnRTm 9/HbT3i+H5r5BT5BsoYtB3wPtJ/gzVfw/2p3El1ZiqXA1VCbF7w1NqMc4eb6wRwzgZ/N DaHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59-v6si47465113plb.314.2018.06.05.02.29.58; Tue, 05 Jun 2018 02:30:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbeFEJ3c (ORCPT + 99 others); Tue, 5 Jun 2018 05:29:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8643 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751437AbeFEJ3b (ORCPT ); Tue, 5 Jun 2018 05:29:31 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 466A159E45A9F; Tue, 5 Jun 2018 17:29:17 +0800 (CST) Received: from [127.0.0.1] (10.177.29.40) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Tue, 5 Jun 2018 17:29:13 +0800 Subject: Re: [PATCH v2 01/21] usb: phy: use match_string() helper To: Andy Shevchenko , Sergei Shtylyov References: <1527765086-19873-1-git-send-email-xieyisheng1@huawei.com> <1527765086-19873-2-git-send-email-xieyisheng1@huawei.com> CC: Linux Kernel Mailing List , USB , Felipe Balbi , "Greg Kroah-Hartman" From: Yisheng Xie Message-ID: <4ea021ae-1284-4519-e467-5c03bc62c98b@huawei.com> Date: Tue, 5 Jun 2018 17:28:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/6/1 2:59, Andy Shevchenko wrote: > On Thu, May 31, 2018 at 9:56 PM, Sergei Shtylyov > 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. >