Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2234347imm; Mon, 28 May 2018 04:28:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoWu2s7pfxfHCPv0XfRHBgnCfPUmqqMDmup8C1AlZ34BnwBLrQ02eOX4j1MnSQ0vbGLjLY2 X-Received: by 2002:a63:77c9:: with SMTP id s192-v6mr10304490pgc.140.1527506906390; Mon, 28 May 2018 04:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506906; cv=none; d=google.com; s=arc-20160816; b=i8z1t2n9LuZByy+hhKV6I840g92vrbiuqyPBAUIccDHnjqaUjYWdaJYuxr6UUDxxYM 730Xv2XY3XOtZlb7uKbznHznl6Z41ZraWMGzOVO992Sqvo9RWM6ufLNUcX9wxs+soTW8 JhubIEyDuaUJTjTRjU6MdN9phKchWEQdwmRAld6aFk/xZmzw6J2OIzHqheXt3sqllFfb SJdJIY7IEY8hnU954sE+yHD744zAIznAX8yYwYUrVDZ/X1lkgOHgVk8ZbApnpEVuGwaw r5vrcqq7vkgXKUwqInSobAcLw9vcPs23wjwj7+6qpJjNgWyqb0QvO5/xrJSUqmXcrJIy /Q1Q== 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=weYmFtPlhJHHsJFL9XRc8vnY2ue3b9WSGRr98ganeyU=; b=ItENvSbeEuxrVGKuW9RMiJpsswB5sVOhuECNFKU3Qli/Z0Dvw6Vo9ytzoQ11pkBo4f VORItwBVJY6wXVFaI1RifgdY2tEOpbeUUALjNfEKfYxgqCOeEGX/WUzGMqMESD90fnSm yrXyTvyZw0qB5Y7QUehfgxtkcx+6/ZiAae2gonBS46Js1jX3Gwlqpp26QGbrsNZB85Lq Zuq0O2nTiLMUftQno/PayVArGumPMZYb7AW1V4f6TCWxVs3FIZCPLoGtikW1aBWvbvp/ dJzAf5wGmXokh+JDx3ma7gYODxXw/t+DCGdCBDqMvLl3mX6TWyxzBWKmyJyxb4tHYHWD s+5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pyw7SYiu; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si7278790plc.415.2018.05.28.04.28.11; Mon, 28 May 2018 04:28:26 -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=@linaro.org header.s=google header.b=Pyw7SYiu; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938244AbeE1L10 (ORCPT + 99 others); Mon, 28 May 2018 07:27:26 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:43650 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932582AbeE1L1Q (ORCPT ); Mon, 28 May 2018 07:27:16 -0400 Received: by mail-io0-f195.google.com with SMTP id t23-v6so13683730ioc.10 for ; Mon, 28 May 2018 04:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=weYmFtPlhJHHsJFL9XRc8vnY2ue3b9WSGRr98ganeyU=; b=Pyw7SYiuEbZp4kuIWaGlPDMT6vtB3uIo8ClQKt0F2noXIrdjECA9rYyjWlzzIwwgWG 5Sd3VCGgjakxwsZtlyhIphspTYlHlKYDQch8Zl/Ua02le8i6PMe0NfD4G/iJlQg4vJIu WhxlHsLm2mF6ietxdefiF1EJyHe/R/Era7DsU= 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=weYmFtPlhJHHsJFL9XRc8vnY2ue3b9WSGRr98ganeyU=; b=TXLGNjEXU5hGjpJNo0bfnjfo1w/RMFPfTqa/fVn4MYETdZlQicB15jZgq49JotB5Lh fk1B3U4uNYrL5oFJQMAW0H+tYy/I694VYBOh4R28qmTWIJ9JOOT0i+r9gVe1ujacIPSq I7BQ8SkUySzvcETeBhNE5r8EyxfqIMyvb4DCMZKb8RW+DFgQpsM162UK39B76ftt4UIn ur/JxdnUAb60cFNdkl/hBaKJi8bydZDxcXYFSqY/gc165Q49mI7rws4m4nNeWJRoTTq7 0mUVXd+yxBxalO4iQKY3Mr9S7Xl3IWPKQAK6i4uO400Ky/Pq7EdvQ7jlatdm3kmyrg2i 7zMw== X-Gm-Message-State: ALKqPwebpatRpT2/8qpYy6fHRjmJAhMXWw9pkermsCdLzVySUn7EOTSH wRf8NctT/Zt+j7OKlFL9vAn/+S9lq1eNbkcWhv9ZBw== X-Received: by 2002:a6b:c6c9:: with SMTP id w192-v6mr10292726iof.131.1527506835270; Mon, 28 May 2018 04:27:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:c054:0:0:0:0:0 with HTTP; Mon, 28 May 2018 04:27:14 -0700 (PDT) In-Reply-To: <1526903890-35761-17-git-send-email-xieyisheng1@huawei.com> References: <1526903890-35761-1-git-send-email-xieyisheng1@huawei.com> <1526903890-35761-17-git-send-email-xieyisheng1@huawei.com> From: Ulf Hansson Date: Mon, 28 May 2018 13:27:14 +0200 Message-ID: Subject: Re: [PATCH 16/33] mmc: sdhci-xenon: use match_string() helper To: Yisheng Xie Cc: Linux Kernel Mailing List , Adrian Hunter , Hu Ziji , "linux-mmc@vger.kernel.org" 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 21 May 2018 at 13:57, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > > Cc: Adrian Hunter > Cc: Hu Ziji > Cc: Ulf Hansson > Cc: linux-mmc@vger.kernel.org > Signed-off-by: Yisheng Xie Thanks, applied for next! Kind regards Uffe > --- > drivers/mmc/host/sdhci-xenon-phy.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c > index ec87943..a35804b 100644 > --- a/drivers/mmc/host/sdhci-xenon-phy.c > +++ b/drivers/mmc/host/sdhci-xenon-phy.c > @@ -814,15 +814,10 @@ static int xenon_add_phy(struct device_node *np, struct sdhci_host *host, > { > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host); > - int i, ret; > + int ret; > > - for (i = 0; i < NR_PHY_TYPES; i++) { > - if (!strcmp(phy_name, phy_types[i])) { > - priv->phy_type = i; > - break; > - } > - } > - if (i == NR_PHY_TYPES) { > + priv->phy_type = match_string(phy_types, NR_PHY_TYPES, phy_name); > + if (priv->phy_type < 0) { > dev_err(mmc_dev(host->mmc), > "Unable to determine PHY name %s. Use default eMMC 5.1 PHY\n", > phy_name); > -- > 1.7.12.4 >