Re: [PATCH v1 0/3] lib/string: introduce match_string() helper

From: Andy Shevchenko
Date: Thu Oct 22 2015 - 07:34:10 EST


On Tue, 2015-09-15 at 11:35 -0400, Tejun Heo wrote:
> Hello,
>
> On Tue, Sep 15, 2015 at 09:53:48AM +0300, Andy Shevchenko wrote:
> > There are users of a simple string matching in the array. Let's do
> > a common
> > helper for that.
> >
> > Two users are updated in the series. one more is coming [1].
> >
> > [1] http://www.spinics.net/lists/kernel/msg2074265.html
> >
> > The series is compile tested.
> >
> > Andy Shevchenko (3):
> > Â lib/string: introduce match_string() helper
> > Â drm/edid: convert to use match_string() helper
> > Â ata: hpt366: convert to use match_string() helper
> >
> > Âdrivers/ata/pata_hpt366.cÂÂÂÂÂÂÂ| 13 +++++--------
> > Âdrivers/gpu/drm/drm_edid_load.c | 17 ++++++-----------
> > Âinclude/linux/string.hÂÂÂÂÂÂÂÂÂÂ|ÂÂ7 +++++++
> > Âlib/string.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 26 ++++++++++++++++++++++++++
> > Â4 files changed, 44 insertions(+), 19 deletions(-)
>
> While increase in LOC isn't the only indicator, we're adding two
> helper functions each for two usages.ÂÂI'm not quite sure the
> addition
> of helpers is paying off here.

Does the following sound better? (Btw, I left only one helper function)

Âdrivers/ata/pata_hpt366.cÂÂÂÂÂÂÂ| 13 +++++--------
Âdrivers/base/property.cÂÂÂÂÂÂÂÂÂ| 10 ++--------
Âdrivers/gpu/drm/drm_edid_load.c | 17 ++++++-----------
Âdrivers/pinctrl/pinmux.cÂÂÂÂÂÂÂÂ| 13 +++----------
Âdrivers/power/ab8500_btemp.cÂÂÂÂ| 11 +++--------
Âdrivers/power/ab8500_charger.cÂÂ| 11 +++--------
Âdrivers/power/ab8500_fg.cÂÂÂÂÂÂÂ| 11 +++--------
Âdrivers/power/abx500_chargalg.c | 10 +++-------
Âdrivers/power/charger-manager.c | 27 ++++-----------------------
Âinclude/linux/string.hÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 ++
Âlib/string.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 26 ++++++++++++++++++++++++++
Â11 files changed, 60 insertions(+), 91 deletions(-)

>
> Thanks.
>

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/