[PATCH -next 1/2] lib/string_choices: Add str_true_false() helper

2024-08-22 Thread Hongbo Li
Add str_true_false() helper to return "true" or "false" string literal. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index 1320bcdcb89c.

[PATCH -next 0/2] Add str_true_false()/str_false_true() helper

2024-08-22 Thread Hongbo Li
Add str_true_false()/str_false_true() helper to "true" or "false" string literal. And we found more than 10 cases currently exist in the tree. So these helpers can be used for these cases. Hongbo Li (2): lib/string_choices: Add str_true_false() helper lib/string_choi

[PATCH -next 2/2] lib/string_choices: Add wrapper for str_false_true()

2024-08-22 Thread Hongbo Li
There are many "false" : "true" format in the kernel tree, so we add str_false_true() as well. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.

Re: [PATCH -next 0/2] Add str_true_false()/str_false_true() helper

2024-08-23 Thread Hongbo Li
On 2024/8/23 21:38, Greg KH wrote: On Fri, Aug 23, 2024 at 04:22:32PM +0300, Andy Shevchenko wrote: On Fri, Aug 23, 2024 at 9:13 AM Hongbo Li wrote: Add str_true_false()/str_false_true() helper to "true" or "false" string literal. And we found more than 10 cases cu

[PATCH -next v2] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-24 Thread Hongbo Li
Add str_true_false()/str_false_true() helper to return "true" or "false" string literal. Signed-off-by: Hongbo Li --- v2: - Squash into a single patch as Andy Shevchenko' suggesstion. v1: - https://lore.kernel.org/all/1deb2bc4-0cd1-41a0-9434-65c02eef7...@huawei.

Re: [PATCH -next v2] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-24 Thread Hongbo Li
As discussed in the previous thread, the coccinelle rules and some replacements will be added in the future. Thanks, Hongbo On 2024/8/24 15:09, Hongbo Li wrote: Add str_true_false()/str_false_true() helper to return "true" or "false" string literal. Signed-off-by

[PATCH -next v3 3/3] nfs make use of str_false_true helper

2024-08-26 Thread Hongbo Li
The helper str_false_true is introduced to reback "false/true" string literal. We can simplify this format by str_false_true. Signed-off-by: Hongbo Li --- fs/nfs/nfs4xdr.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4x

[PATCH -next v3 2/3] mm: make use of str_true_false helper

2024-08-26 Thread Hongbo Li
The helper str_true_false is introduced to reback "true/false" string literal. We can simplify this format by str_true_false. Signed-off-by: Hongbo Li --- mm/memory-tiers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memory-tiers.c b/mm/memory-tie

[PATCH -next v3 0/3] Add str_true_false()/str_false_true() helper

2024-08-26 Thread Hongbo Li
tps://lore.kernel.org/all/1deb2bc4-0cd1-41a0-9434-65c02eef7...@huawei.com/T/ Hongbo Li (3): lib/string_choices: Add str_true_false()/str_false_true() helper mm: make use of str_true_false helper nfs make use of str_false_true helper fs/nfs/nfs4xdr.c | 11 +-- include/li

[PATCH -next v3 1/3] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-26 Thread Hongbo Li
Add str_true_false()/str_false_true() helper to return "true" or "false" string literal. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.

Re: [PATCH -next v3 3/3] nfs make use of str_false_true helper

2024-08-26 Thread Hongbo Li
On 2024/8/27 11:33, Matthew Wilcox wrote: On Tue, Aug 27, 2024 at 10:45:17AM +0800, Hongbo Li wrote: The helper str_false_true is introduced to reback "false/true" string literal. We can simplify this format by str_false_true. This seems unnecessarily verbose & compl

Re: [PATCH -next v3 1/3] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-27 Thread Hongbo Li
On 2024/8/28 7:42, Andrew Morton wrote: On Tue, 27 Aug 2024 10:45:15 +0800 Hongbo Li wrote: Add str_true_false()/str_false_true() helper to return "true" or "false" string literal. ... --- a/include/linux/string_choices.h +++ b/include/linux/string_choices.h @@ -4

Re: [PATCH -next v3 1/3] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-27 Thread Hongbo Li
On 2024/8/28 11:22, Andrew Morton wrote: On Wed, 28 Aug 2024 09:48:21 +0800 Hongbo Li wrote: This might result in copies of the strings "true" and "false" being generated for every .c file which uses this function, resulting in unnecessary bloat. It's possible tha

Re: [PATCH -next v3 1/3] lib/string_choices: Add str_true_false()/str_false_true() helper

2024-08-28 Thread Hongbo Li
On 2024/8/29 4:25, Andrew Morton wrote: On Wed, 28 Aug 2024 11:49:51 +0800 Hongbo Li wrote: Anything which is calling these functions is not performance-sensitive, so optimizing for space is preferred. An out-of-line function which returns a const char * will achieve this? I think this

[PATCH -next 0/2] coccinelle: Add rules to find str_true_false/str_false_true replacements

2024-08-29 Thread Hongbo Li
After str_true_false()/str_false_true() has been introduced in the tree, we can add rules for finding places where str_true_false()/str_false_true() can be used. Hongbo Li (2): coccinelle: Add rules to find str_true_false() replacements coccinelle: Add rules to find str_false_true

[PATCH -next 1/2] coccinelle: Add rules to find str_true_false() replacements

2024-08-29 Thread Hongbo Li
After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by: Hongbo Li --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c:910:40-44: opportunity for

[PATCH -next 2/2] coccinelle: Add rules to find str_false_true() replacements

2024-08-29 Thread Hongbo Li
As done with str_true_false(), add checks for str_false_true() opportunities. A simple test can find over 9 cases currently exist in the tree. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a

[PATCH -next 0/4] Introduce several opposite string choice helpers

2024-08-31 Thread Hongbo Li
cases) exist in the code can be replaced with these helper. Patch 1: Introduce the string choice helpers Patch 2~4: Give the relative use cases to use these helpers. Hongbo Li (4): lib/string_choices: Introduce several opposite string choice helpers tun: Make use of str_disabled_enabled helper

[PATCH -next 2/4] tun: Make use of str_disabled_enabled helper

2024-08-31 Thread Hongbo Li
Use str_disabled_enabled() helper instead of open coding the same. Signed-off-by: Hongbo Li --- drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6fe5e8f7017c..29647704bda8 100644 --- a/drivers/net/tun.c +++ b

[PATCH -next 1/4] lib/string_choices: Introduce several opposite string choice helpers

2024-08-31 Thread Hongbo Li
cases) exist in the code can be replaced with these helper. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index f3670dbd1169..c2134eeda1fd 100644 --- a/include/

Re: [PATCH -next 2/4] tun: Make use of str_disabled_enabled helper

2024-09-01 Thread Hongbo Li
On 2024/9/1 4:07, Jakub Kicinski wrote: On Sat, 31 Aug 2024 17:58:38 +0800 Hongbo Li wrote: Use str_disabled_enabled() helper instead of open coding the same. diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6fe5e8f7017c..29647704bda8 100644 --- a/drivers/net/tun.c +++ b/drivers

[PATCH net-next 4/4] net: sock: Make use of str_no_yes() helper

2024-08-31 Thread Hongbo Li
The helper str_no_yes is introduced to reback "no/yes" string literal. We can use str_no_yes() helper instead of open coding the same. Signed-off-by: Hongbo Li --- net/core/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/so

[PATCH -next 3/4] mm: page_alloc: Make use of str_off_on helper

2024-08-31 Thread Hongbo Li
The helper str_off_on is introduced to reback "off/on" string literal. We can use str_off_on() helper instead of open coding the same. Signed-off-by: Hongbo Li --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_all

Re: [PATCH -next 2/4] tun: Make use of str_disabled_enabled helper

2024-09-02 Thread Hongbo Li
On 2024/9/2 22:30, Willem de Bruijn wrote: Andy Shevchenko wrote: On Sat, Aug 31, 2024 at 01:07:41PM -0700, Jakub Kicinski wrote: On Sat, 31 Aug 2024 17:58:38 +0800 Hongbo Li wrote: Use str_disabled_enabled() helper instead of open coding the same. ... netif_info(tun

[PATCH -next] mmc: sdhci-cadence: Annotate struct sdhci_cdns_phy_param with __counted_by()

2024-09-03 Thread Hongbo Li
Add the __counted_by compiler attribute to the flexible array member entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Hongbo Li --- drivers/mmc/host/sdhci-cadence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH -next] dmaengine: Loongson1: Annotate struct ls1x_dma_chan with __counted_by()

2024-09-03 Thread Hongbo Li
Add the __counted_by compiler attribute to the flexible array member entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Hongbo Li --- drivers/dma/loongson1-apb-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH -next] net: dsa: felix: Annotate struct action_gate_entry with __counted_by

2024-09-03 Thread Hongbo Li
Add the __counted_by compiler attribute to the flexible array member entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Hongbo Li --- drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH -next 2/4] tun: Make use of str_disabled_enabled helper

2024-09-03 Thread Hongbo Li
On 2024/9/3 23:09, Andy Shevchenko wrote: On Tue, Sep 03, 2024 at 02:25:53PM +0800, Hongbo Li wrote: On 2024/9/2 22:30, Willem de Bruijn wrote: Andy Shevchenko wrote: On Sat, Aug 31, 2024 at 01:07:41PM -0700, Jakub Kicinski wrote: On Sat, 31 Aug 2024 17:58:38 +0800 Hongbo Li wrote

Re: [PATCH -next 0/2] coccinelle: Add rules to find str_true_false/str_false_true replacements

2024-09-03 Thread Hongbo Li
On 2024/8/29 19:24, Hongbo Li wrote: After str_true_false()/str_false_true() has been introduced in the tree, we can add rules for finding places where str_true_false()/str_false_true() can be used. Hongbo Li (2): coccinelle: Add rules to find str_true_false() replacements coccinelle

Re: [PATCH -next 0/2] coccinelle: Add rules to find str_true_false/str_false_true replacements

2024-09-04 Thread Hongbo Li
On 2024/9/4 15:37, Andy Shevchenko wrote: On Wed, Sep 4, 2024 at 5:36 AM Hongbo Li wrote: On 2024/8/29 19:24, Hongbo Li wrote: ... I found that there are still a few function rules that are not complete, such as str_on_off, str_enable_disable, str_yes_no. How about adding these rules as

[PATCH -next v2 4/9] coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_lo{w}_hi{gh}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 46 + 1 file changed, 46 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b

[PATCH -next v2 0/9] coccinelle: Add some rules for string_chioces helpers.

2024-09-04 Thread Hongbo Li
i/cx23885/cimax2.c:227:4-8: opportunity for str_read_write(read) drivers/media/usb/em28xx/em28xx-video.c:941:4-9: opportunity for str_enabled_disabled(flags) ``` Changes since v1: - Add more rules for helpers in string_choices.h. Thanks, Hongbo. Hongbo Li (9): coccinelle: Add rules to f

[PATCH -next v2 2/9] coccinelle: Add rules to find str_false_true() replacements

2024-09-04 Thread Hongbo Li
As done with str_true_false(), add checks for str_false_true() opportunities. A simple test can find over 9 cases currently exist in the tree. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a

[PATCH -next v2 7/9] coccinelle: Add rules to find str_write_read() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_write_read() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v2 9/9] coccinelle: Add rules to find str_yes_no() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_yes_no() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v2 8/9] coccinelle: Add rules to find str_on_off() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_on_off() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v2 3/9] coccinelle: Add rules to find str_hi{gh}_lo{w}() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_hi{gh}_lo{w}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 46 + 1 file changed, 46 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b

[PATCH -next v2 1/9] coccinelle: Add rules to find str_true_false() replacements

2024-09-04 Thread Hongbo Li
After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23

[PATCH -next v2 6/9] coccinelle: Add rules to find str_read_write() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_read_write() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 23 + 1 file changed, 23 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v2 5/9] coccinelle: Add rules to find str_enable{d}_disable{d}() replacements

2024-09-04 Thread Hongbo Li
As other rules done, we add rules for str_enable{d}_ disable{d}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 46 + 1 file changed, 46 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci

Re: [PATCH -next] mmc: sdhci-cadence: Annotate struct sdhci_cdns_phy_param with __counted_by()

2024-09-04 Thread Hongbo Li
On 2024/9/5 8:16, Gustavo A. R. Silva wrote: [..] -    struct sdhci_cdns_phy_param phy_params[]; +    struct sdhci_cdns_phy_param phy_params[] __counted_by(count); It seems there is no such `count` member in the structure[1]. Since `counted_by` hasn't been released in GCC yet. Please, mak

[PATCH -next v2 2/2] lib/string_choices: Add some comments to make more clear for string choices helpers.

2024-09-05 Thread Hongbo Li
Add some comments to explain why we should use string_choices helpers. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index c2134eeda1fd..5a89261d3918

[PATCH -next v2 0/2] Introduce several opposite string choice helpers

2024-09-05 Thread Hongbo Li
-1-lihongb...@huawei.com/ Hongbo Li (2): lib/string_choices: Introduce several opposite string choice helpers lib/string_choices: Add some comments to make more clear for string choices helpers. include/linux/string_choices.h | 17 + 1 file changed, 17 insertions(+) -- 2.34.1

[PATCH -next v2 1/2] lib/string_choices: Introduce several opposite string choice helpers

2024-09-05 Thread Hongbo Li
cases) exist in the code can be replaced with these helper. Signed-off-by: Hongbo Li --- include/linux/string_choices.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/string_choices.h b/include/linux/string_choices.h index f3670dbd1169..c2134eeda1fd 100644 --- a/include/

Re: [PATCH -next v2 0/9] coccinelle: Add some rules for string_chioces helpers.

2024-09-09 Thread Hongbo Li
On 2024/9/4 17:14, Hongbo Li wrote: We found that many of the detection rules for helpers in string_choices.h are missing. This series of patches is intended to complete these rules. We have verified in the latest kernel tree that these rules can detect many places where the string choices

Re: [PATCH -next v2 1/9] coccinelle: Add rules to find str_true_false() replacements

2024-09-09 Thread Hongbo Li
On 2024/9/10 0:00, Julia Lawall wrote: On Wed, 4 Sep 2024, Hongbo Li wrote: After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by: Hongbo Li --- scripts

Re: [PATCH -next v2 1/9] coccinelle: Add rules to find str_true_false() replacements

2024-09-09 Thread Hongbo Li
On 2024/9/10 10:23, Hongbo Li wrote: On 2024/9/10 0:00, Julia Lawall wrote: On Wed, 4 Sep 2024, Hongbo Li wrote: After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations

[PATCH -next v3 01/10] coccinelle: Add rules to find str_true_false() replacements

2024-09-10 Thread Hongbo Li
After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19

[PATCH -next v3 03/10] coccinelle: Add rules to find str_hi{gh}_lo{w}() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_hi{gh}_lo{w}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 42 + 1 file changed, 42 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b

[PATCH -next v3 06/10] coccinelle: Add rules to find str_read_write() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_read_write() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v3 05/10] coccinelle: Add rules to find str_enable{d}_disable{d}() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_enable{d}_ disable{d}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 38 + 1 file changed, 38 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci

[PATCH -next v3 02/10] coccinelle: Add rules to find str_false_true() replacements

2024-09-10 Thread Hongbo Li
As done with str_true_false(), add checks for str_false_true() opportunities. A simple test can find over 9 cases currently exist in the tree. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --git a

[PATCH -next v3 08/10] coccinelle: Add rules to find str_on_off() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_on_off() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v3 04/10] coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_lo{w}_hi{gh}() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 38 + 1 file changed, 38 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b

[PATCH -next v3 00/10] coccinelle: Add some rules for string_chioces helpers.

2024-09-10 Thread Hongbo Li
choices.h. Thanks, Hongbo. Hongbo Li (10): coccinelle: Add rules to find str_true_false() replacements coccinelle: Add rules to find str_false_true() replacements coccinelle: Add rules to find str_hi{gh}_lo{w}() replacements coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements

[PATCH -next v3 07/10] coccinelle: Add rules to find str_write_read() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_write_read() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v3 09/10] coccinelle: Add rules to find str_yes_no() replacements

2024-09-10 Thread Hongbo Li
As other rules done, we add rules for str_yes_no() to check the relative opportunities. Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 19 +++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts

[PATCH -next v3 10/10] coccinelle: Remove unnecessary parentheses for only one possible change.

2024-09-10 Thread Hongbo Li
The parentheses are only needed if there is a disjunction, ie a set of possible changes. If there is only one pattern, we can remove these parentheses. Just like the format: - x + y not: ( - x + y ) Signed-off-by: Hongbo Li --- scripts/coccinelle/api/string_choices.cocci | 8

Re: [PATCH -next v3 00/10] coccinelle: Add some rules for string_chioces helpers.

2024-09-14 Thread Hongbo Li
Hi, Gently ping for this. Thanks, Hongbo On 2024/9/11 9:09, Hongbo Li wrote: We found that many of the detection rules for helpers in string_choices.h are missing. This series of patches is intended to complete these rules. We have verified in the latest kernel tree that these rules can

Re: [PATCH -next v3 01/10] coccinelle: Add rules to find str_true_false() replacements

2024-09-23 Thread Hongbo Li
On 2024/9/19 14:25, Julia Lawall wrote: On Wed, 11 Sep 2024, Hongbo Li wrote: After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by: Hongbo Li --- scripts

Re: [PATCH -next v3 01/10] coccinelle: Add rules to find str_true_false() replacements

2024-09-27 Thread Hongbo Li
On 2024/9/23 18:24, Julia Lawall wrote: Thanks for testing it. I will see if there is some other way to improve the performance. May be every rules in the same file are executed sequentially cost a lot? Thanks, Hongbo Sent from my iPhone On 23 Sep 2024, at 09:01, Hongbo Li wrote