Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp935858imm; Thu, 31 May 2018 12:03:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuVGrCZk+4CASoOZUthnTZ1sC9EYXYcoxdpEoXsUp9dQIy56H0MBKCqtuarivx5kcYGjbN X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr8147063plb.355.1527793430000; Thu, 31 May 2018 12:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527793429; cv=none; d=google.com; s=arc-20160816; b=AP3aPK4yEE7pUfQxB0lrEjGM+F5h9DyzCIg8MZqiAHH+pKrKa2/1NwkI1f/t21vnuL uDRkzHFxK/bcMDVNs6fbWmyhtl1dEABJ56JHqKFM4v28lVsNQfz15/MA5ovwPilZorDS z54u/S5397+dToesI+rJ+/Oe7Dem0i7vFe8W0hQg7/UmCYmTy6CwWYeQyG0QXgMSvniT Vs/lqQdjjy+Rl7QlxudPG8JlQPNF70eqdBCS2ZE3IKrdv/uWFWPvw1ndsLt6vJt7VimC NCVBDv4xkfuQGzXXDCLV8woJmG018qSPPKQWDR9l6ziPvbuNCyrajE/etVPMop9Eyt2D xThA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ofj2T61Atm76GsUCcZNPxhxfuxK7Wf8lMZNRfZ5urgI=; b=rciHvDnUW+I9OQeQvyKUNp4ws1ZgjZu3ohL2S4d4kMDqZBzskDq1100+csoUDUANON /nzOKnS/XZhKj6Lg9i6Wh/zsJ9qXilb8hQGh7zKwNkQfoYayNj4o6U2tPsgcscOkdpOF WgPqJrgOyI0q/F4NYzWxDQwdHfF1R6zoL+okkO7geLYPOXWP1y0k/QARrVQXE47YmYSC ixS+qQzVXMSG1+udj8FYrBsy/jjlA3GgtktNkkyi4/S24rhtxcxwwga+jXnOQCnDcqGv ZFZu28uaj02gYLn7bp5kHwjqUvGv6rUaI/Z+wOAMloIEk42BDehvCJaQ1qACFCswmC/q 5Ybg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vYdJYUx6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si37082461plb.558.2018.05.31.12.03.04; Thu, 31 May 2018 12:03:49 -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=@gmail.com header.s=20161025 header.b=vYdJYUx6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756024AbeEaS7U (ORCPT + 99 others); Thu, 31 May 2018 14:59:20 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:43419 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755895AbeEaS7R (ORCPT ); Thu, 31 May 2018 14:59:17 -0400 Received: by mail-qt0-f194.google.com with SMTP id y89-v6so3695112qtd.10; Thu, 31 May 2018 11:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ofj2T61Atm76GsUCcZNPxhxfuxK7Wf8lMZNRfZ5urgI=; b=vYdJYUx6E19deigqpjfKd//CNOeSzIgMYMwcNzfDPbYlUPCFLKLZIA515guYXpd3ou cpFZIdi2+p5DjPnQilPJ5es4xrURXr9a7thH+MQeNJI8E3iVAfPv9sXIoSBWAw/9EqBY Wc5z8qZ4JNJLz5lDCrcwYkrm4ZG9wlNTx9JyZDNbMnxOZEb6vZuc0KdudDEMJ+nmk0Tb VnXt+jVJo+8WyAbNAi+17E4ropfJZEXUv6R/OvA3D/BrWWcy+N2OVtLyQp2qnIjksomd ISomET60qlMR0Zr59S4tmCh239E9gbGca370s5u5dQTnuXCZvuGV5XDOFVVyzdAy5T43 LJig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ofj2T61Atm76GsUCcZNPxhxfuxK7Wf8lMZNRfZ5urgI=; b=a+pjqOyYWSCQN8sBNcNbGQJkIt4FYgche2uEzcvcIlzuVAqGFsr3I7m4cQxz0Ss3f+ WX8jRAULCJsQg/Tw3bFH+0yC1KnrxpRLY3c4qY4qMcL7RGrKtIh+E7hk4cgbB/MueLhy zq1zzxTuKcLWL1IPyn4A6AQ+CyIKEOz5pBeayy7SIaxoOY9RUcwkMOh+3RNfcr5BfGzE P776enhLrMRDCBsZ3G/rsIU6INOBKD9IYn+StNMmTVdbQCIrQ7ZmjX5j04ZZyFzqn9sk nmkCFUIp+Myx1caT7vk7dUNfve99SXNZzwaKkpLZAG2AQIg2CxNl4tfnUes3HhbOns/9 x6Qg== X-Gm-Message-State: APt69E02+Z3PCnay1hXcHNaJbFUWDa0sTlyIiztO0o/0aHJ8c2j2g23C 6pbXIYDke9OJC/qY21EXmiXQZ4WNGVGeCqbrrmg= X-Received: by 2002:ac8:430e:: with SMTP id z14-v6mr5236618qtm.105.1527793156803; Thu, 31 May 2018 11:59:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9896:0:0:0:0:0 with HTTP; Thu, 31 May 2018 11:59:16 -0700 (PDT) In-Reply-To: References: <1527765086-19873-1-git-send-email-xieyisheng1@huawei.com> <1527765086-19873-2-git-send-email-xieyisheng1@huawei.com> From: Andy Shevchenko Date: Thu, 31 May 2018 21:59:16 +0300 Message-ID: Subject: Re: [PATCH v2 01/21] usb: phy: use match_string() helper To: Sergei Shtylyov Cc: Yisheng Xie , Linux Kernel Mailing List , USB , Felipe Balbi , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >> 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. -- With Best Regards, Andy Shevchenko