* [PATCH 00/10] lib/string_choices: Add new helpers
@ 2025-02-26 5:34 Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 02/10] lib/string_choices: Add str_enabling_disabling() helper Kuninori Morimoto
` (10 more replies)
0 siblings, 11 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:34 UTC (permalink / raw)
To: Kees Cook, linux-hardening
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(+)
--
2.43.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 02/10] lib/string_choices: Add str_enabling_disabling() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
@ 2025-02-26 5:35 ` Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 01/10] lib/string_choices: Add str_tx_rx() helper Kuninori Morimoto
` (9 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:35 UTC (permalink / raw)
To: Kees Cook, linux-hardening, Kees Cook, linux-hardening
Add str_enabling_disabling() helper to return "enabling" or "disabling"
string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index fbbf1e657806..2a6c8df585ea 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -29,6 +29,12 @@ static inline const char *str_enabled_disabled(bool v)
}
#define str_disabled_enabled(v) str_enabled_disabled(!(v))
+static inline const char *str_enabling_disabling(bool v)
+{
+ return v ? "enabling" : "disabling";
+}
+#define str_disabling_enabling(v) str_enabling_disabling(!(v))
+
static inline const char *str_hi_lo(bool v)
{
return v ? "hi" : "lo";
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 01/10] lib/string_choices: Add str_tx_rx() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 02/10] lib/string_choices: Add str_enabling_disabling() helper Kuninori Morimoto
@ 2025-02-26 5:35 ` Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 03/10] lib/string_choices: Add str_in_out() helper Kuninori Morimoto
` (8 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:35 UTC (permalink / raw)
To: Kees Cook, linux-hardening, Kees Cook, linux-hardening
Add str_tx_rx() helper to return "tx" or "rx" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 120ca0f28e95..fbbf1e657806 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -71,6 +71,12 @@ static inline const char *str_true_false(bool v)
}
#define str_false_true(v) str_true_false(!(v))
+static inline const char *str_tx_rx(bool v)
+{
+ return v ? "tx" : "rx";
+}
+#define str_rx_tx(v) str_tx_rx(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 03/10] lib/string_choices: Add str_in_out() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 02/10] lib/string_choices: Add str_enabling_disabling() helper Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 01/10] lib/string_choices: Add str_tx_rx() helper Kuninori Morimoto
@ 2025-02-26 5:35 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 04/10] lib/string_choices: Add str_input_output() helper Kuninori Morimoto
` (7 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:35 UTC (permalink / raw)
To: Kees Cook, linux-hardening, Kees Cook, linux-hardening
Add str_in_out() helper to return "in" or "out" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 2a6c8df585ea..96b54874dc3a 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -83,6 +83,12 @@ static inline const char *str_tx_rx(bool v)
}
#define str_rx_tx(v) str_tx_rx(!(v))
+static inline const char *str_in_out(bool v)
+{
+ return v ? "in" : "out";
+}
+#define str_out_in(v) str_in_out(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 04/10] lib/string_choices: Add str_input_output() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (2 preceding siblings ...)
2025-02-26 5:35 ` [PATCH 03/10] lib/string_choices: Add str_in_out() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 05/10] lib/string_choices: Add str_Y_N() helper Kuninori Morimoto
` (6 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_input_output() helper to return "input" or "output" string
literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 96b54874dc3a..cc7c771f4e84 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -89,6 +89,12 @@ static inline const char *str_in_out(bool v)
}
#define str_out_in(v) str_in_out(!(v))
+static inline const char *str_input_output(bool v)
+{
+ return v ? "input" : "output";
+}
+#define str_output_input(v) str_input_output(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/10] lib/string_choices: Add str_Y_N() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (3 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 04/10] lib/string_choices: Add str_input_output() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 06/10] lib/string_choices: Add str_pass_fail() helper Kuninori Morimoto
` (5 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_Y_N() helper to return "Y" or "N" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index cc7c771f4e84..615ddbde4743 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -65,6 +65,12 @@ static inline const char *str_yes_no(bool v)
}
#define str_no_yes(v) str_yes_no(!(v))
+static inline const char *str_Y_N(bool v)
+{
+ return v ? "Y" : "N";
+}
+#define str_N_Y(v) str_Y_N(!(v))
+
static inline const char *str_up_down(bool v)
{
return v ? "up" : "down";
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/10] lib/string_choices: Add str_pass_fail() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (4 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 05/10] lib/string_choices: Add str_Y_N() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 07/10] lib/string_choices: Add str_to_from() helper Kuninori Morimoto
` (4 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_pass_fail() helper to return "pass" or "fail" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 615ddbde4743..d52ced93e21e 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -101,6 +101,12 @@ static inline const char *str_input_output(bool v)
}
#define str_output_input(v) str_input_output(!(v))
+static inline const char *str_pass_fail(bool v)
+{
+ return v ? "pass" : "fail";
+}
+#define str_fail_pass(v) str_pass_fail(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/10] lib/string_choices: Add str_to_from() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (5 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 06/10] lib/string_choices: Add str_pass_fail() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 08/10] lib/string_choices: Add str_level_edge() helper Kuninori Morimoto
` (3 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_to_from() helper to return "to" or "from" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index d52ced93e21e..e07a9a5e403e 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -107,6 +107,12 @@ static inline const char *str_pass_fail(bool v)
}
#define str_fail_pass(v) str_pass_fail(!(v))
+static inline const char *str_to_from(bool v)
+{
+ return v ? "to" : "from";
+}
+#define str_from_to(v) str_to_from(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 08/10] lib/string_choices: Add str_level_edge() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (6 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 07/10] lib/string_choices: Add str_to_from() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 09/10] lib/string_choices: Add str_kernel_user() helper Kuninori Morimoto
` (2 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_level_edge() helper to return "level" or "edge" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index e07a9a5e403e..1965d3a5976b 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -113,6 +113,12 @@ static inline const char *str_to_from(bool v)
}
#define str_from_to(v) str_to_from(!(v))
+static inline const char *str_level_edge(bool v)
+{
+ return v ? "level" : "edge";
+}
+#define str_edge_level(v) str_level_edge(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/10] lib/string_choices: Add str_kernel_user() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (7 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 08/10] lib/string_choices: Add str_level_edge() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 10/10] lib/string_choices: Add str_attach_detach() helper Kuninori Morimoto
2025-02-28 19:44 ` [PATCH 00/10] lib/string_choices: Add new helpers Kees Cook
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_kernel_user() helper to return "kernel" or "user" string literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 1965d3a5976b..82c5927d50a9 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -119,6 +119,12 @@ static inline const char *str_level_edge(bool v)
}
#define str_edge_level(v) str_level_edge(!(v))
+static inline const char *str_kernel_user(bool v)
+{
+ return v ? "kernel" : "user";
+}
+#define str_user_kernel(v) str_kernel_user(!(v))
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 10/10] lib/string_choices: Add str_attach_detach() helper
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (8 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 09/10] lib/string_choices: Add str_kernel_user() helper Kuninori Morimoto
@ 2025-02-26 5:36 ` Kuninori Morimoto
2025-02-28 19:44 ` [PATCH 00/10] lib/string_choices: Add new helpers Kees Cook
10 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-02-26 5:36 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Add str_attach_detach() helper to return "attach" or "detach" string
literal.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
include/linux/string_choices.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h
index 82c5927d50a9..12b26cb5ca6f 100644
--- a/include/linux/string_choices.h
+++ b/include/linux/string_choices.h
@@ -125,6 +125,13 @@ static inline const char *str_kernel_user(bool v)
}
#define str_user_kernel(v) str_kernel_user(!(v))
+static inline const char *str_attach_detach(bool v)
+{
+ return v ? "attach" : "detach";
+}
+#define str_attach_detach(v) str_attach_detach(!(v))
+
+
/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
--
2.43.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
` (9 preceding siblings ...)
2025-02-26 5:36 ` [PATCH 10/10] lib/string_choices: Add str_attach_detach() helper Kuninori Morimoto
@ 2025-02-28 19:44 ` Kees Cook
2025-02-28 20:24 ` Andy Shevchenko
2025-03-02 23:16 ` Kuninori Morimoto
10 siblings, 2 replies; 19+ messages in thread
From: Kees Cook @ 2025-02-28 19:44 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Andy Shevchenko, linux-hardening
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
>
--
Kees Cook
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-02-28 19:44 ` [PATCH 00/10] lib/string_choices: Add new helpers Kees Cook
@ 2025-02-28 20:24 ` Andy Shevchenko
2025-03-03 17:18 ` Kees Cook
2025-03-02 23:16 ` Kuninori Morimoto
1 sibling, 1 reply; 19+ messages in thread
From: Andy Shevchenko @ 2025-02-28 20:24 UTC (permalink / raw)
To: Kees Cook; +Cc: Kuninori Morimoto, Andy Shevchenko, linux-hardening
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/
?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-02-28 19:44 ` [PATCH 00/10] lib/string_choices: Add new helpers Kees Cook
2025-02-28 20:24 ` Andy Shevchenko
@ 2025-03-02 23:16 ` Kuninori Morimoto
2025-03-03 6:20 ` Andy Shevchenko
1 sibling, 1 reply; 19+ messages in thread
From: Kuninori Morimoto @ 2025-03-02 23:16 UTC (permalink / raw)
To: Kees Cook; +Cc: Andy Shevchenko, linux-hardening
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
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-03-02 23:16 ` Kuninori Morimoto
@ 2025-03-03 6:20 ` Andy Shevchenko
2025-03-03 17:13 ` Kees Cook
0 siblings, 1 reply; 19+ messages in thread
From: Andy Shevchenko @ 2025-03-03 6:20 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: Kees Cook, Andy Shevchenko, linux-hardening
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.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-03-03 6:20 ` Andy Shevchenko
@ 2025-03-03 17:13 ` Kees Cook
2025-03-04 1:43 ` Kuninori Morimoto
0 siblings, 1 reply; 19+ messages in thread
From: Kees Cook @ 2025-03-03 17:13 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Kuninori Morimoto, Andy Shevchenko, linux-hardening
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
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-02-28 20:24 ` Andy Shevchenko
@ 2025-03-03 17:18 ` Kees Cook
2025-03-03 17:26 ` Andy Shevchenko
0 siblings, 1 reply; 19+ messages in thread
From: Kees Cook @ 2025-03-03 17:18 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Kuninori Morimoto, Andy Shevchenko, linux-hardening
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
--
Kees Cook
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-03-03 17:18 ` Kees Cook
@ 2025-03-03 17:26 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2025-03-03 17:26 UTC (permalink / raw)
To: Kees Cook; +Cc: Kuninori Morimoto, Andy Shevchenko, linux-hardening
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.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/10] lib/string_choices: Add new helpers
2025-03-03 17:13 ` Kees Cook
@ 2025-03-04 1:43 ` Kuninori Morimoto
0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2025-03-04 1:43 UTC (permalink / raw)
To: Kees Cook; +Cc: Andy Shevchenko, Andy Shevchenko, linux-hardening
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
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-03-04 1:43 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 5:34 [PATCH 00/10] lib/string_choices: Add new helpers Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 02/10] lib/string_choices: Add str_enabling_disabling() helper Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 01/10] lib/string_choices: Add str_tx_rx() helper Kuninori Morimoto
2025-02-26 5:35 ` [PATCH 03/10] lib/string_choices: Add str_in_out() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 04/10] lib/string_choices: Add str_input_output() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 05/10] lib/string_choices: Add str_Y_N() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 06/10] lib/string_choices: Add str_pass_fail() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 07/10] lib/string_choices: Add str_to_from() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 08/10] lib/string_choices: Add str_level_edge() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 09/10] lib/string_choices: Add str_kernel_user() helper Kuninori Morimoto
2025-02-26 5:36 ` [PATCH 10/10] lib/string_choices: Add str_attach_detach() helper Kuninori Morimoto
2025-02-28 19:44 ` [PATCH 00/10] lib/string_choices: Add new helpers Kees Cook
2025-02-28 20:24 ` Andy Shevchenko
2025-03-03 17:18 ` Kees Cook
2025-03-03 17:26 ` Andy Shevchenko
2025-03-02 23:16 ` Kuninori Morimoto
2025-03-03 6:20 ` Andy Shevchenko
2025-03-03 17:13 ` Kees Cook
2025-03-04 1:43 ` Kuninori Morimoto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.