mbox series

[00/10] lib/string_choices: Add new helpers

Message ID 87y0xt6zgn.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series lib/string_choices: Add new helpers | expand

Message

Kuninori Morimoto Feb. 26, 2025, 5:34 a.m. UTC
Hi Kees

I would like to use string_choices helper to cleanup the code, but it missing
some of well used string pair in kernel. This patch-set adds it.

Kuninori Morimoto (10):
  lib/string_choices: Add str_tx_rx() helper
  lib/string_choices: Add str_enabling_disabling() helper
  lib/string_choices: Add str_in_out() helper
  lib/string_choices: Add str_input_output() helper
  lib/string_choices: Add str_Y_N() helper
  lib/string_choices: Add str_pass_fail() helper
  lib/string_choices: Add str_to_from() helper
  lib/string_choices: Add str_level_edge() helper
  lib/string_choices: Add str_kernel_user() helper
  lib/string_choices: Add str_attach_detach() helper

 include/linux/string_choices.h | 61 ++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

Comments

Kees Cook Feb. 28, 2025, 7:44 p.m. UTC | #1
On Wed, Feb 26, 2025 at 05:34:48AM +0000, Kuninori Morimoto wrote:
> I would like to use string_choices helper to cleanup the code, but it missing
> some of well used string pair in kernel. This patch-set adds it.

Do you have some Coccinelle scripts or other patches that show the use
of these helpers? We tend to avoid adding new helpers to the kernel
unless there are active uses of them.

-Kees

> 
> Kuninori Morimoto (10):
>   lib/string_choices: Add str_tx_rx() helper
>   lib/string_choices: Add str_enabling_disabling() helper
>   lib/string_choices: Add str_in_out() helper
>   lib/string_choices: Add str_input_output() helper
>   lib/string_choices: Add str_Y_N() helper
>   lib/string_choices: Add str_pass_fail() helper
>   lib/string_choices: Add str_to_from() helper
>   lib/string_choices: Add str_level_edge() helper
>   lib/string_choices: Add str_kernel_user() helper
>   lib/string_choices: Add str_attach_detach() helper
> 
>  include/linux/string_choices.h | 61 ++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> -- 
> 2.43.0
>
Andy Shevchenko Feb. 28, 2025, 8:24 p.m. UTC | #2
On Fri, Feb 28, 2025 at 9:44 PM Kees Cook <kees@kernel.org> wrote:
>
> On Wed, Feb 26, 2025 at 05:34:48AM +0000, Kuninori Morimoto wrote:
> > I would like to use string_choices helper to cleanup the code, but it missing
> > some of well used string pair in kernel. This patch-set adds it.
>
> Do you have some Coccinelle scripts or other patches that show the use
> of these helpers? We tend to avoid adding new helpers to the kernel
> unless there are active uses of them.

Kees, what is the status of the
https://lore.kernel.org/linux-kernel/20241119021719.7659-1-prosunofficial@gmail.com/
?
Kuninori Morimoto March 2, 2025, 11:16 p.m. UTC | #3
Hi Kees

Thank you for your feedback

> > I would like to use string_choices helper to cleanup the code, but it missing
> > some of well used string pair in kernel. This patch-set adds it.
> 
> Do you have some Coccinelle scripts or other patches that show the use
> of these helpers? We tend to avoid adding new helpers to the kernel
> unless there are active uses of them.

I have a lot of patches which uses new helper functions.
Because it has dependency (add new helper 1st, use it in 2nd), and
different maintainers (helper patch maintainers vs each driver/framwork
maintainers), I have posted new helper patch-set 1st (= this patch-set).
After that, I will post 2nd patch-set which uses new helper, like
new helper patch for v6.15, each driver/framework patch for v6.16, etc.

Because there are a lot of patches which uses new helpers, is it OK to
indicates some of them (as sample patch) ?

# It is still under compile-test on each architecture

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Andy Shevchenko March 3, 2025, 6:20 a.m. UTC | #4
On Mon, Mar 3, 2025 at 1:16 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Kees
>
> Thank you for your feedback
>
> > > I would like to use string_choices helper to cleanup the code, but it missing
> > > some of well used string pair in kernel. This patch-set adds it.
> >
> > Do you have some Coccinelle scripts or other patches that show the use
> > of these helpers? We tend to avoid adding new helpers to the kernel
> > unless there are active uses of them.
>
> I have a lot of patches which uses new helper functions.
> Because it has dependency (add new helper 1st, use it in 2nd), and
> different maintainers (helper patch maintainers vs each driver/framwork
> maintainers), I have posted new helper patch-set 1st (= this patch-set).
> After that, I will post 2nd patch-set which uses new helper, like
> new helper patch for v6.15, each driver/framework patch for v6.16, etc.
>
> Because there are a lot of patches which uses new helpers, is it OK to
> indicates some of them (as sample patch) ?

I am not Kees, but my point of view on this is that you may take one
subsystem which, for example, I can review (listed as a Designated
Reviewer or Maintainer in the MAINTAINERS) and add sample patches from
it. It will speed up the process as my tag would suffice. Also you can
add into the cover letter the statistics (how many drivers are
affected (per subsystem/folder) by each of the new helpers in the
upcoming series.
Kees Cook March 3, 2025, 5:13 p.m. UTC | #5
On Mon, Mar 03, 2025 at 08:20:20AM +0200, Andy Shevchenko wrote:
> On Mon, Mar 3, 2025 at 1:16 AM Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> >
> >
> > Hi Kees
> >
> > Thank you for your feedback
> >
> > > > I would like to use string_choices helper to cleanup the code, but it missing
> > > > some of well used string pair in kernel. This patch-set adds it.
> > >
> > > Do you have some Coccinelle scripts or other patches that show the use
> > > of these helpers? We tend to avoid adding new helpers to the kernel
> > > unless there are active uses of them.
> >
> > I have a lot of patches which uses new helper functions.
> > Because it has dependency (add new helper 1st, use it in 2nd), and
> > different maintainers (helper patch maintainers vs each driver/framwork
> > maintainers), I have posted new helper patch-set 1st (= this patch-set).
> > After that, I will post 2nd patch-set which uses new helper, like
> > new helper patch for v6.15, each driver/framework patch for v6.16, etc.
> >
> > Because there are a lot of patches which uses new helpers, is it OK to
> > indicates some of them (as sample patch) ?
> 
> I am not Kees, but my point of view on this is that you may take one
> subsystem which, for example, I can review (listed as a Designated
> Reviewer or Maintainer in the MAINTAINERS) and add sample patches from
> it. It will speed up the process as my tag would suffice. Also you can
> add into the cover letter the statistics (how many drivers are
> affected (per subsystem/folder) by each of the new helpers in the
> upcoming series.

Yeah, I'd say just post the series you have and in the cover letter
refer to this series as a prerequisite.
Kees Cook March 3, 2025, 5:18 p.m. UTC | #6
On Fri, Feb 28, 2025 at 10:24:22PM +0200, Andy Shevchenko wrote:
> On Fri, Feb 28, 2025 at 9:44 PM Kees Cook <kees@kernel.org> wrote:
> >
> > On Wed, Feb 26, 2025 at 05:34:48AM +0000, Kuninori Morimoto wrote:
> > > I would like to use string_choices helper to cleanup the code, but it missing
> > > some of well used string pair in kernel. This patch-set adds it.
> >
> > Do you have some Coccinelle scripts or other patches that show the use
> > of these helpers? We tend to avoid adding new helpers to the kernel
> > unless there are active uses of them.
> 
> Kees, what is the status of the
> https://lore.kernel.org/linux-kernel/20241119021719.7659-1-prosunofficial@gmail.com/
> ?

Fell through the cracks! I've applied patch 1 now.

If we can see some conversions for locked/unlocked, we can do patch 2 as
well.

-Kees
Andy Shevchenko March 3, 2025, 5:26 p.m. UTC | #7
On Mon, Mar 3, 2025 at 7:18 PM Kees Cook <kees@kernel.org> wrote:
> On Fri, Feb 28, 2025 at 10:24:22PM +0200, Andy Shevchenko wrote:
> > On Fri, Feb 28, 2025 at 9:44 PM Kees Cook <kees@kernel.org> wrote:

...

> > Kees, what is the status of the
> > https://lore.kernel.org/linux-kernel/20241119021719.7659-1-prosunofficial@gmail.com/
> > ?
>
> Fell through the cracks! I've applied patch 1 now.

Thank you!

> If we can see some conversions for locked/unlocked, we can do patch 2 as
> well.

Definitely.
Kuninori Morimoto March 4, 2025, 1:43 a.m. UTC | #8
Hi Kees, Andy

Thank you for your feedback

> > > > Do you have some Coccinelle scripts or other patches that show the use
> > > > of these helpers? We tend to avoid adding new helpers to the kernel
> > > > unless there are active uses of them.
(snip)
> > I am not Kees, but my point of view on this is that you may take one
> > subsystem which, for example, I can review (listed as a Designated
> > Reviewer or Maintainer in the MAINTAINERS) and add sample patches from
> > it. It will speed up the process as my tag would suffice. Also you can
> > add into the cover letter the statistics (how many drivers are
> > affected (per subsystem/folder) by each of the new helpers in the
> > upcoming series.
> 
> Yeah, I'd say just post the series you have and in the cover letter
> refer to this series as a prerequisite.

OK, I will post v2 patch which includes sample patch which is using
new string helper functions.

Thank you for your help !!

Best regards
---
Kuninori Morimoto