mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] checkpatch: fix perl v5.20 warning: useless use of greediness modifier
@ 2014-09-15 15:12 Roman Pen
  2014-09-15 15:19 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Pen @ 2014-09-15 15:12 UTC (permalink / raw)
  Cc: Roman Pen, Andy Whitcroft, Joe Perches, linux-kernel

on my perl v5.20 I got:
  Useless use of greediness modifier '+' in regex; marked by
  <-- HERE in m/(^\+.*) {8,8}+ <-- HERE \t/ at ./scripts/checkpatch.pl line 2427.

greediness modifier '+' in construction '\s{8,8}+' does not make
any sense, because we already specify how many chars do we expect.

Also we can avoid second ',8' and use simple '\s{8}'.

Signed-off-by: Roman Pen <r.peniaev@gmail.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4d08b39..ccd3234 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2424,7 +2424,7 @@ sub process {
 				"please, no space before tabs\n" . $herevet) &&
 			    $fix) {
 				while ($fixed[$fixlinenr] =~
-					   s/(^\+.*) {8,8}+\t/$1\t\t/) {}
+					   s/(^\+.*) {8}\t/$1\t\t/) {}
 				while ($fixed[$fixlinenr] =~
 					   s/(^\+.*) +\t/$1\t/) {}
 			}
-- 
2.0.0


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

* Re: [PATCH 1/1] checkpatch: fix perl v5.20 warning: useless use of greediness modifier
  2014-09-15 15:12 [PATCH 1/1] checkpatch: fix perl v5.20 warning: useless use of greediness modifier Roman Pen
@ 2014-09-15 15:19 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-09-15 15:19 UTC (permalink / raw)
  To: Roman Pen; +Cc: Andy Whitcroft, linux-kernel

On Tue, 2014-09-16 at 00:12 +0900, Roman Pen wrote:
> on my perl v5.20 I got:
>   Useless use of greediness modifier '+' in regex; marked by
>   <-- HERE in m/(^\+.*) {8,8}+ <-- HERE \t/ at ./scripts/checkpatch.pl line 2427.
> 
> greediness modifier '+' in construction '\s{8,8}+' does not make
> any sense, because we already specify how many chars do we expect.
> 
> Also we can avoid second ',8' and use simple '\s{8}'.

Thanks Roman, it's already fixed in -next.

http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/scripts/checkpatch.pl?id=66cb4ee0e52ca721f609fd5eec16187189ae5fda



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

end of thread, other threads:[~2014-09-15 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-15 15:12 [PATCH 1/1] checkpatch: fix perl v5.20 warning: useless use of greediness modifier Roman Pen
2014-09-15 15:19 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®