Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp929581imm; Thu, 31 May 2018 11:57:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLfmxBcRQtwuoWmxuvltdLVT0XR2K0hsT5rtwuBw+PCfCQtaQjw0AkVGzjdSGgqC2+QgPk4 X-Received: by 2002:a63:7c01:: with SMTP id x1-v6mr6384436pgc.286.1527793077146; Thu, 31 May 2018 11:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527793077; cv=none; d=google.com; s=arc-20160816; b=n7DCHNrjyfiKWeI80UN590pFD4pXgh9BZFY+47gSyfTNrRkkZubnlX5iTxyFvszpEL kF3WGEYeQFvTxHujL9CTHGSmb6lyn497GugupKa8BQXHn6trFwx74paXkJOLm6ZqjdoT b/sGGMVWK7zD3oezQg7DKQs4X50Y2Z+0akExqhTMCgQk/Inv14aFStpwmkXGlkqgajmJ xYmFUc2oKoC7rfeaG0Io6hEQlzB9A41jPUMnECw9Sq0Jm3RRxVLXKfjWlxRbMuaAtNrh YqoMH9bUJd+rO+myiNNGLTyBPSxXLbWzxnJExjeLswCQZbJp5Czv//Fmkt2+5dMs6wok 2xzg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=OsFut/82ZuZye2swyhV3ocCNh/YLmfvCHk3O6HokRPg=; b=nMa9yiwSZLUBDeSq1I1sM60Ot+MDP9dVt6sO7SbnWWP1yLqQoc/R0hMaem6uVy0IKj Bw9CWHG2xY1yeegQmkHk3UHKC5gAbcztdWEQ6X63XA4eqi+wMLzV2SK5JEGfGOXDt6R+ kw84SZZodSUXKHLc9mICuj8str6Aa9EvORzybp9U8q+E3Ut7aLh/Q1KZo1QMDaKet0qO eH4KISc4fjOQFolWtunj+9KoWnSIKRIRWGWdWb6hvsNbMZ17Lrra01uiwHO9RwLGfGdc SaixwoNrl9B4FWxvZ/H9wKI7HPh0AiSVdCssX9dJry1rwrkUgan/+4SmQ59qsPegasxQ 1xFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=Kzadt6nR; 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 k185-v6si1556911pgd.22.2018.05.31.11.57.35; Thu, 31 May 2018 11:57:57 -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; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=Kzadt6nR; 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 S1756088AbeEaS4N (ORCPT + 99 others); Thu, 31 May 2018 14:56:13 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36419 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755955AbeEaS4K (ORCPT ); Thu, 31 May 2018 14:56:10 -0400 Received: by mail-lf0-f67.google.com with SMTP id u4-v6so11245575lff.3 for ; Thu, 31 May 2018 11:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OsFut/82ZuZye2swyhV3ocCNh/YLmfvCHk3O6HokRPg=; b=Kzadt6nRlfQaVL2V5cZIeHvLFN2VKb2Ct8dmwjoTf1XTyId5OtTDMI7aZ0a8ysv14U 9QYEfmt1KNGKkpLAeDyqtRuyuUM3Xmrn2B5YWwZE8uNVgp8yoThEPMlHhvyytCxSqnFv ReKhC05iGdvQqf59HC2WqQcMwgPFwPEPoaVNeqIRSOgv0wQ6QF52RwZimXShVBXfmGSG x5mxFg2+xDD6Y8mFZdkY9+0oAw/J86A222StulZhhM3u01XYfM+O3fnjv4FGFQH3dnU9 n97EvX7oRevZBiHRIiHVGozJVKRjJyRLUnHlyg6HW46uB9cJ6dO4fI3M99FHNW7lNHrj 6uDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OsFut/82ZuZye2swyhV3ocCNh/YLmfvCHk3O6HokRPg=; b=WMKaQ0X+CxoHCll88u0gYw1FqqD6RoM8HD+7/ggQcfRra3mGfCLD2010ecodoOFHtA nuKq/rgDcpWFp9QFe2lobR/1ontZ7pEFsfcmCJJZM9tbRqlV0Qx7A0LdF/P4/3OMB6w9 N+S12Xg+XOXlJPtFt3uwRK2K63Pqp/9I/+oh/hwv4JtjsE/9++ihwiDdkL74TNxAizDX oX6+Ca8uIxry4FU26KwJDnJgUdnexRbKyZ8JXsZ5zr+lDm7azTD9QXoSyx5xyG7c+pgk lPd7nqSqiwnmqob+wnP/pvzcL4dalxj3/rnqUjVR35OFXzqnX4jUh2lUx8YDPawqssAA saEA== X-Gm-Message-State: ALKqPweCCbbuoy/VXclgKOh4Mz4b/2OfDCT7WOfMfN+jyA2BiuLnSdIl 1dvbkJ6twcTgIG9TL+U6/Exn2Q== X-Received: by 2002:a19:e82c:: with SMTP id f44-v6mr4800552lfh.19.1527792967886; Thu, 31 May 2018 11:56:07 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.82.221]) by smtp.gmail.com with ESMTPSA id c12-v6sm7762284lji.59.2018.05.31.11.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 11:56:06 -0700 (PDT) Subject: Re: [PATCH v2 01/21] usb: phy: use match_string() helper To: Andy Shevchenko Cc: Yisheng Xie , Linux Kernel Mailing List , USB , Felipe Balbi , Greg Kroah-Hartman References: <1527765086-19873-1-git-send-email-xieyisheng1@huawei.com> <1527765086-19873-2-git-send-email-xieyisheng1@huawei.com> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Thu, 31 May 2018 21:56:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/31/2018 09:47 PM, Andy Shevchenko wrote: >>> - donot rename err to ret - per Andy >> >> Hm... > >>> - 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. :-) > 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. MBR, Sergei