LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH 02/16] treewide: rename match_string() -> __match_string()
Date: Wed, 08 May 2019 10:00:06 -0700	[thread overview]
Message-ID: <155733480678.14659.15999974975874060801@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20190508112842.11654-4-alexandru.ardelean@analog.com>

(Trimming the lists but keeping lkml)

Quoting Alexandru Ardelean (2019-05-08 04:28:28)
> This change does a rename of match_string() -> __match_string().
> 
> There are a few parts to the intention here (with this change):
> 1. Align with sysfs_match_string()/__sysfs_match_string()
> 2. This helps to group users of `match_string()` into simple users:
>    a. those that use ARRAY_SIZE(_a) to specify the number of elements
>    b. those that use -1 to pass a NULL terminated array of strings
>    c. special users, which (after eliminating 1 & 2) are not that many
> 3. The final intent is to fix match_string()/__match_string() which is
>    slightly broken, in the sense that passing -1 or a positive value does
>    not make any difference: the iteration will stop at the first NULL
>    element.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
[...]
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 96053a96fe2f..0b6c3d300411 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2305,8 +2305,8 @@ bool clk_has_parent(struct clk *clk, struct clk *parent)
>         if (core->parent == parent_core)
>                 return true;
>  
> -       return match_string(core->parent_names, core->num_parents,
> -                           parent_core->name) >= 0;
> +       return __match_string(core->parent_names, core->num_parents,
> +                             parent_core->name) >= 0;

This is essentially ARRAY_SIZE(core->parent_names) so it should be fine
to put this back to match_string() later in the series.

>  }
>  EXPORT_SYMBOL_GPL(clk_has_parent);
>  
> diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
> index c3ad92965823..373f13e9cd83 100644
> --- a/drivers/clk/rockchip/clk.c
> +++ b/drivers/clk/rockchip/clk.c
> @@ -276,8 +276,8 @@ static struct clk *rockchip_clk_register_frac_branch(
>                 struct clk *mux_clk;
>                 int ret;
>  
> -               frac->mux_frac_idx = match_string(child->parent_names,
> -                                                 child->num_parents, name);
> +               frac->mux_frac_idx = __match_string(child->parent_names,
> +                                                   child->num_parents, name);

I suspect this is the same as above, but Heiko can ack/confirm.

>                 frac->mux_ops = &clk_mux_ops;
>                 frac->clk_nb.notifier_call = rockchip_clk_frac_notifier_cb;
>  

  reply	other threads:[~2019-05-08 17:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 11:28 [PATCH 00/16] treewide: fix match_string() helper when array size Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 01/16] lib: fix match_string() helper on -1 " Alexandru Ardelean
2019-05-08 11:31   ` Ardelean, Alexandru
2019-05-08 11:28 ` [PATCH 01/16] lib: fix match_string() helper when array size is positive Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 02/16] treewide: rename match_string() -> __match_string() Alexandru Ardelean
2019-05-08 17:00   ` Stephen Boyd [this message]
2019-05-09  8:52     ` Ardelean, Alexandru
2019-05-09 17:23       ` Stephen Boyd
2019-05-09  9:02     ` Heiko Stuebner
2019-05-08 11:28 ` [PATCH 03/16] lib,treewide: add new match_string() helper/macro Alexandru Ardelean
2019-05-08 13:11   ` Andy Shevchenko
2019-05-08 13:18     ` Greg KH
2019-05-08 13:22       ` Ardelean, Alexandru
2019-05-10  9:15         ` Ardelean, Alexandru
2019-05-10 14:34           ` andriy.shevchenko
2019-05-13  7:00             ` Ardelean, Alexandru
2019-05-08 11:28 ` [PATCH 04/16] powerpc/xmon: use " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 05/16] ALSA: oxygen: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 06/16] x86/mtrr: use new match_string() helper + add gaps == minor fix Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 07/16] device connection: use new match_string() helper/macro Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 08/16] cpufreq/intel_pstate: remove NULL entry + use match_string() Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro Alexandru Ardelean
2019-05-08 12:20   ` Dan Carpenter
2019-05-08 11:28 ` [PATCH 10/16] pinctrl: armada-37xx: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 11/16] mm/vmpressure.c: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 12/16] rdmacg: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 13/16] drm/edid: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 14/16] staging: gdm724x: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 15/16] video: fbdev: pxafb: " Alexandru Ardelean
2019-05-08 11:28 ` [PATCH 16/16] sched: debug: " Alexandru Ardelean
2019-05-28  7:39 ` [PATCH 1/3][V2] lib: fix match_string() helper on -1 array size Alexandru Ardelean
2019-05-28  7:39   ` [PATCH 2/3][V2] treewide: rename match_string() -> __match_string() Alexandru Ardelean
2019-05-28  7:39   ` [PATCH 3/3][V2] lib: re-introduce new match_string() helper/macro Alexandru Ardelean

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=155733480678.14659.15999974975874060801@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 02/16] treewide: rename match_string() -> __match_string()' \
    /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

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).