From: Ulf Hansson <ulf.hansson@linaro.org>
To: Yisheng Xie <xieyisheng1@huawei.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Hu Ziji <huziji@marvell.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 16/33] mmc: sdhci-xenon: use match_string() helper
Date: Mon, 28 May 2018 13:27:14 +0200 [thread overview]
Message-ID: <CAPDyKFoSb1sBaNPtfrZKaa++VA3rKKvcXb6cpue8pzjca7wbPg@mail.gmail.com> (raw)
In-Reply-To: <1526903890-35761-17-git-send-email-xieyisheng1@huawei.com>
On 21 May 2018 at 13:57, Yisheng Xie <xieyisheng1@huawei.com> 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 <adrian.hunter@intel.com>
> Cc: Hu Ziji <huziji@marvell.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc@vger.kernel.org
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
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
>
prev parent reply other threads:[~2018-05-28 11:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1526903890-35761-1-git-send-email-xieyisheng1@huawei.com>
2018-05-21 11:57 ` [PATCH 16/33] mmc: sdhci-xenon: use match_string() helper Yisheng Xie
2018-05-24 7:58 ` Adrian Hunter
2018-05-28 11:27 ` Ulf Hansson [this message]
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=CAPDyKFoSb1sBaNPtfrZKaa++VA3rKKvcXb6cpue8pzjca7wbPg@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--cc=adrian.hunter@intel.com \
--cc=huziji@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--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).