All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] checkpatch: refactor and add new alloc w/ multiply tests
@ 2023-09-13 20:37 Joe Perches
  2023-09-13 20:37 ` [PATCH 1/2] checkpatch: Simplify creating search strings Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Joe Perches @ 2023-09-13 20:37 UTC (permalink / raw)
  To: Andrew Morton, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, Andy Whitcroft, linux-kernel

Original alloc function patch by Gustavo Silva

Joe Perches (2):
  checkpatch: Simplify creating search strings
  checkpatch: Add a couple new alloc functions to alloc with multiplies check

 scripts/checkpatch.pl | 55 +++++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 34 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] checkpatch: Simplify creating search strings
  2023-09-13 20:37 [PATCH 0/2] checkpatch: refactor and add new alloc w/ multiply tests Joe Perches
@ 2023-09-13 20:37 ` Joe Perches
  2023-09-13 20:37 ` [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check Joe Perches
  2023-09-14  1:41 ` [PATCH V2 " Joe Perches
  2 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2023-09-13 20:37 UTC (permalink / raw)
  To: Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel

Use join and map instead of loops.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 34 +++++++---------------------------
 1 file changed, 7 insertions(+), 27 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7d16f863edf1c..617f9e53bacdf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -625,18 +625,8 @@ our $signature_tags = qr{(?xi:
 our @link_tags = qw(Link Closes);
 
 #Create a search and print patterns for all these strings to be used directly below
-our $link_tags_search = "";
-our $link_tags_print = "";
-foreach my $entry (@link_tags) {
-	if ($link_tags_search ne "") {
-		$link_tags_search .= '|';
-		$link_tags_print .= ' or ';
-	}
-	$entry .= ':';
-	$link_tags_search .= $entry;
-	$link_tags_print .= "'$entry'";
-}
-$link_tags_search = "(?:${link_tags_search})";
+our $link_tags_search = '(?:' . join('|', @link_tags) . ')';
+our $link_tags_print = "'" . join("' or '", @link_tags) . "'";
 
 our $tracing_logging_tags = qr{(?xi:
 	[=-]*> |
@@ -819,15 +809,10 @@ our @mode_permission_funcs = (
 	["__ATTR", 2],
 );
 
-my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';
-
 #Create a search pattern for all these functions to speed up a loop below
-our $mode_perms_search = "";
-foreach my $entry (@mode_permission_funcs) {
-	$mode_perms_search .= '|' if ($mode_perms_search ne "");
-	$mode_perms_search .= $entry->[0];
-}
-$mode_perms_search = "(?:${mode_perms_search})";
+our $mode_perms_search = '(?:' . join('|', map{$_->[0]} @mode_permission_funcs) . ')';
+
+my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';
 
 our %deprecated_apis = (
 	"synchronize_rcu_bh"			=> "synchronize_rcu",
@@ -847,12 +832,7 @@ our %deprecated_apis = (
 );
 
 #Create a search pattern for all these strings to speed up a loop below
-our $deprecated_apis_search = "";
-foreach my $entry (keys %deprecated_apis) {
-	$deprecated_apis_search .= '|' if ($deprecated_apis_search ne "");
-	$deprecated_apis_search .= $entry;
-}
-$deprecated_apis_search = "(?:${deprecated_apis_search})";
+our $deprecated_apis_search = '(?:' . join('|', keys %deprecated_apis) . ')';
 
 our $mode_perms_world_writable = qr{
 	S_IWUGO		|
@@ -887,7 +867,7 @@ foreach my $entry (keys %mode_permission_string_types) {
 	$mode_perms_string_search .= '|' if ($mode_perms_string_search ne "");
 	$mode_perms_string_search .= $entry;
 }
-our $single_mode_perms_string_search = "(?:${mode_perms_string_search})";
+our $single_mode_perms_string_search = '(?:' . join('|', keys %mode_permission_string_types) . ')';
 our $multi_mode_perms_string_search = qr{
 	${single_mode_perms_string_search}
 	(?:\s*\|\s*${single_mode_perms_string_search})*
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 20:37 [PATCH 0/2] checkpatch: refactor and add new alloc w/ multiply tests Joe Perches
  2023-09-13 20:37 ` [PATCH 1/2] checkpatch: Simplify creating search strings Joe Perches
@ 2023-09-13 20:37 ` Joe Perches
  2023-09-13 22:14   ` Gustavo A. R. Silva
  2023-09-14  1:41 ` [PATCH V2 " Joe Perches
  2 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2023-09-13 20:37 UTC (permalink / raw)
  To: Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel

vmalloc() and vzalloc() functions have now 2-factor multiplication
argument forms vmalloc_array() and vcalloc(), correspondingly.

Add alloc-with-multiplies checks for these new functions.

Simplify the original codes repeated else to use a hash.

Link: https://github.com/KSPP/linux/issues/342

Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/lkml/ZQCaO+tYycDxVLy7@work/
Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 617f9e53bacdf..4cb248985eefc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -834,6 +834,16 @@ our %deprecated_apis = (
 #Create a search pattern for all these strings to speed up a loop below
 our $deprecated_apis_search = '(?:' . join('|', keys %deprecated_apis) . ')';
 
+our %alloc_with_multiply_apis = (
+	"kmalloc"		=> "kmalloc_array",
+	"kvmalloc"		=> "kvmalloc_array",
+	"vmalloc"		=> "vmalloc_array",
+	"kvzalloc"		=> "kvcalloc",
+	"kzalloc"		=> "kcalloc",
+	"vzalloc"		=> "vcalloc",
+);
+our $alloc_with_multiply_search = '(?:' . join('|', keys %alloc_with_multiply_apis) . ')';
+
 our $mode_perms_world_writable = qr{
 	S_IWUGO		|
 	S_IWOTH		|
@@ -7187,17 +7197,14 @@ sub process {
 			    "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
 		}
 
-# check for (kv|k)[mz]alloc with multiplies that could be kmalloc_array/kvmalloc_array/kvcalloc/kcalloc
+# check for various allocs with multiplies that should use safer functions
 		if ($perl_version_ok &&
 		    defined $stat &&
-		    $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) {
+		    $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*($alloc_with_multiply_search)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) {
 			my $oldfunc = $3;
+			my $newfunc = $alloc_with_multiply_apis{$oldfunc};
 			my $a1 = $4;
 			my $a2 = $10;
-			my $newfunc = "kmalloc_array";
-			$newfunc = "kvmalloc_array" if ($oldfunc eq "kvmalloc");
-			$newfunc = "kvcalloc" if ($oldfunc eq "kvzalloc");
-			$newfunc = "kcalloc" if ($oldfunc eq "kzalloc");
 			my $r1 = $a1;
 			my $r2 = $a2;
 			if ($a1 =~ /^sizeof\s*\S/) {
@@ -7213,7 +7220,7 @@ sub process {
 					 "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) &&
 				    $cnt == 1 &&
 				    $fix) {
-					$fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
+					$fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*($oldfunc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
 				}
 			}
 		}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 20:37 ` [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check Joe Perches
@ 2023-09-13 22:14   ` Gustavo A. R. Silva
  2023-09-13 22:25     ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Gustavo A. R. Silva @ 2023-09-13 22:14 UTC (permalink / raw)
  To: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel



On 9/13/23 14:37, Joe Perches wrote:
> vmalloc() and vzalloc() functions have now 2-factor multiplication
> argument forms vmalloc_array() and vcalloc(), correspondingly.
> 
> Add alloc-with-multiplies checks for these new functions.
> 
> Simplify the original codes repeated else to use a hash.
> 
> Link: https://github.com/KSPP/linux/issues/342
> 
> Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Why don't you wait for a response or a v2 from the original
submitter?

--
Gustavo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 22:14   ` Gustavo A. R. Silva
@ 2023-09-13 22:25     ` Joe Perches
  2023-09-13 22:32       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2023-09-13 22:25 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Andrew Morton, Andy Whitcroft,
	Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel

On Wed, 2023-09-13 at 16:14 -0600, Gustavo A. R. Silva wrote:
> 
> On 9/13/23 14:37, Joe Perches wrote:
> > vmalloc() and vzalloc() functions have now 2-factor multiplication
> > argument forms vmalloc_array() and vcalloc(), correspondingly.
> > 
> > Add alloc-with-multiplies checks for these new functions.
> > 
> > Simplify the original codes repeated else to use a hash.
> > 
> > Link: https://github.com/KSPP/linux/issues/342
> > 
> > Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Why don't you wait for a response or a v2 from the original
> submitter?

Because there really is no need to wait.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 22:25     ` Joe Perches
@ 2023-09-13 22:32       ` Gustavo A. R. Silva
  2023-09-13 22:34         ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Gustavo A. R. Silva @ 2023-09-13 22:32 UTC (permalink / raw)
  To: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel



On 9/13/23 16:25, Joe Perches wrote:
> On Wed, 2023-09-13 at 16:14 -0600, Gustavo A. R. Silva wrote:
>>
>> On 9/13/23 14:37, Joe Perches wrote:
>>> vmalloc() and vzalloc() functions have now 2-factor multiplication
>>> argument forms vmalloc_array() and vcalloc(), correspondingly.
>>>
>>> Add alloc-with-multiplies checks for these new functions.
>>>
>>> Simplify the original codes repeated else to use a hash.
>>>
>>> Link: https://github.com/KSPP/linux/issues/342
>>>
>>> Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>
>> Why don't you wait for a response or a v2 from the original
>> submitter?
> 
> Because there really is no need to wait.

By the way, did you test it?

--
Gustavo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 22:32       ` Gustavo A. R. Silva
@ 2023-09-13 22:34         ` Joe Perches
  2023-09-13 22:41           ` Gustavo A. R. Silva
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2023-09-13 22:34 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Andrew Morton, Andy Whitcroft,
	Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel

On Wed, 2023-09-13 at 16:32 -0600, Gustavo A. R. Silva wrote:
> 
> On 9/13/23 16:25, Joe Perches wrote:
> > On Wed, 2023-09-13 at 16:14 -0600, Gustavo A. R. Silva wrote:
> > > 
> > > On 9/13/23 14:37, Joe Perches wrote:
> > > > vmalloc() and vzalloc() functions have now 2-factor multiplication
> > > > argument forms vmalloc_array() and vcalloc(), correspondingly.
> > > > 
> > > > Add alloc-with-multiplies checks for these new functions.
> > > > 
> > > > Simplify the original codes repeated else to use a hash.
> > > > 
> > > > Link: https://github.com/KSPP/linux/issues/342
> > > > 
> > > > Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > > 
> > > Why don't you wait for a response or a v2 from the original
> > > submitter?
> > 
> > Because there really is no need to wait.
> 
> By the way, did you test it?

Yes, against arch/s390/include/asm/idals.h

Did you?  If so, you could also add your own tested-by...


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 22:34         ` Joe Perches
@ 2023-09-13 22:41           ` Gustavo A. R. Silva
  2023-09-13 23:00             ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Gustavo A. R. Silva @ 2023-09-13 22:41 UTC (permalink / raw)
  To: Joe Perches, Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel



On 9/13/23 16:34, Joe Perches wrote:
> On Wed, 2023-09-13 at 16:32 -0600, Gustavo A. R. Silva wrote:
>>
>> On 9/13/23 16:25, Joe Perches wrote:
>>> On Wed, 2023-09-13 at 16:14 -0600, Gustavo A. R. Silva wrote:
>>>>
>>>> On 9/13/23 14:37, Joe Perches wrote:
>>>>> vmalloc() and vzalloc() functions have now 2-factor multiplication
>>>>> argument forms vmalloc_array() and vcalloc(), correspondingly.
>>>>>
>>>>> Add alloc-with-multiplies checks for these new functions.
>>>>>
>>>>> Simplify the original codes repeated else to use a hash.
>>>>>
>>>>> Link: https://github.com/KSPP/linux/issues/342
>>>>>
>>>>> Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>>>
>>>> Why don't you wait for a response or a v2 from the original
>>>> submitter?
>>>
>>> Because there really is no need to wait.
>>
>> By the way, did you test it?
> 
> Yes, against arch/s390/include/asm/idals.h

I don't see any instances of vmalloc() or vzalloc() in that file.

--
Gustavo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 22:41           ` Gustavo A. R. Silva
@ 2023-09-13 23:00             ` Joe Perches
  0 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2023-09-13 23:00 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Andrew Morton, Andy Whitcroft,
	Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo Silva, linux-kernel

On Wed, 2023-09-13 at 16:41 -0600, Gustavo A. R. Silva wrote:
> 
> On 9/13/23 16:34, Joe Perches wrote:
> > On Wed, 2023-09-13 at 16:32 -0600, Gustavo A. R. Silva wrote:
> > > 
> > > On 9/13/23 16:25, Joe Perches wrote:
> > > > On Wed, 2023-09-13 at 16:14 -0600, Gustavo A. R. Silva wrote:
> > > > > 
> > > > > On 9/13/23 14:37, Joe Perches wrote:
> > > > > > vmalloc() and vzalloc() functions have now 2-factor multiplication
> > > > > > argument forms vmalloc_array() and vcalloc(), correspondingly.
> > > > > > 
> > > > > > Add alloc-with-multiplies checks for these new functions.
> > > > > > 
> > > > > > Simplify the original codes repeated else to use a hash.
> > > > > > 
> > > > > > Link: https://github.com/KSPP/linux/issues/342
> > > > > > 
> > > > > > Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > > > > 
> > > > > Why don't you wait for a response or a v2 from the original
> > > > > submitter?
> > > > 
> > > > Because there really is no need to wait.
> > > 
> > > By the way, did you test it?
> > 
> > Yes, against arch/s390/include/asm/idals.h
> 
> I don't see any instances of vmalloc() or vzalloc() in that file.

<snort>  Cute.

Missing a ? in the original search '\s*,?'
or just its removal...

Likely the removal would be better.

thanks, cheers, Joe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH V2 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check
  2023-09-13 20:37 [PATCH 0/2] checkpatch: refactor and add new alloc w/ multiply tests Joe Perches
  2023-09-13 20:37 ` [PATCH 1/2] checkpatch: Simplify creating search strings Joe Perches
  2023-09-13 20:37 ` [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check Joe Perches
@ 2023-09-14  1:41 ` Joe Perches
  2 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2023-09-14  1:41 UTC (permalink / raw)
  To: Andrew Morton, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn
  Cc: Gustavo A . R . Silva, linux-kernel

vmalloc() and vzalloc() functions have now 2-factor multiplication
argument forms vmalloc_array() and vcalloc(), correspondingly.

Add alloc-with-multiplies checks for these new functions.

Simplify the original codes repeated else to use a hash.

Link: https://github.com/KSPP/linux/issues/342

Original-patch-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Co-developed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/lkml/ZQCaO+tYycDxVLy7@work/
Signed-off-by: Joe Perches <joe@perches.com>
---

v2: Fix search because vmalloc functions don't take a 3rd argument

 scripts/checkpatch.pl | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 617f9e53bacdf..4cb248985eefc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -834,6 +834,16 @@ our %deprecated_apis = (
 #Create a search pattern for all these strings to speed up a loop below
 our $deprecated_apis_search = '(?:' . join('|', keys %deprecated_apis) . ')';
 
+our %alloc_with_multiply_apis = (
+	"kmalloc"		=> "kmalloc_array",
+	"kvmalloc"		=> "kvmalloc_array",
+	"vmalloc"		=> "vmalloc_array",
+	"kvzalloc"		=> "kvcalloc",
+	"kzalloc"		=> "kcalloc",
+	"vzalloc"		=> "vcalloc",
+);
+our $alloc_with_multiply_search = '(?:' . join('|', keys %alloc_with_multiply_apis) . ')';
+
 our $mode_perms_world_writable = qr{
 	S_IWUGO		|
 	S_IWOTH		|
@@ -7187,17 +7197,14 @@ sub process {
 			    "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
 		}
 
-# check for (kv|k)[mz]alloc with multiplies that could be kmalloc_array/kvmalloc_array/kvcalloc/kcalloc
+# check for various allocs with multiplies that should use safer functions
 		if ($perl_version_ok &&
 		    defined $stat &&
-		    $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) {
+		    $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*($alloc_with_multiply_search)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/) {
 			my $oldfunc = $3;
+			my $newfunc = $alloc_with_multiply_apis{$oldfunc};
 			my $a1 = $4;
 			my $a2 = $10;
-			my $newfunc = "kmalloc_array";
-			$newfunc = "kvmalloc_array" if ($oldfunc eq "kvmalloc");
-			$newfunc = "kvcalloc" if ($oldfunc eq "kvzalloc");
-			$newfunc = "kcalloc" if ($oldfunc eq "kzalloc");
 			my $r1 = $a1;
 			my $r2 = $a2;
 			if ($a1 =~ /^sizeof\s*\S/) {
@@ -7213,7 +7220,7 @@ sub process {
 					 "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) &&
 				    $cnt == 1 &&
 				    $fix) {
-					$fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k)[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
+					$fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*($oldfunc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
 				}
 			}
 		}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-14  1:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13 20:37 [PATCH 0/2] checkpatch: refactor and add new alloc w/ multiply tests Joe Perches
2023-09-13 20:37 ` [PATCH 1/2] checkpatch: Simplify creating search strings Joe Perches
2023-09-13 20:37 ` [PATCH 2/2] checkpatch: Add a couple new alloc functions to alloc with multiplies check Joe Perches
2023-09-13 22:14   ` Gustavo A. R. Silva
2023-09-13 22:25     ` Joe Perches
2023-09-13 22:32       ` Gustavo A. R. Silva
2023-09-13 22:34         ` Joe Perches
2023-09-13 22:41           ` Gustavo A. R. Silva
2023-09-13 23:00             ` Joe Perches
2023-09-14  1:41 ` [PATCH V2 " Joe Perches

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.