Re: [PATCH] checkpatch: add check for the buggy while_each_thread()
On Sun, 18 Jan 2015 17:27:33 -0800 Joe Perches wrote: > On Sun, 2015-01-18 at 17:24 +0300, Sergey Dyasly wrote: > > Now it's preferable to use for_each_thread() instead of while_each_thread(). > > Add a check to checkpatch.pl in order to prevent any new usages of the buggy > > while_each_thread() when possible. > [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -3255,6 +3255,12 @@ sub process { > > "Prefer dev_$level(... to dev_printk(KERN_$orig, > > ...\n" . $herecurr); > > } > > > > +# Check for the buggy while_each_thread() > > + if ($line =~ /\bwhile_each_thread\(/) { > > \bwhile_each_thread\s*\( > or maybe > \bwhile_each_thread\b > > > + WARN("WHILE_EACH_THREAD", > > +"Prefer to use for_each_thread() instead of the > > buggy while_each_thread(). See commit > > 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n" . $herecurr); > > Pretty long commit id, 12 is probably enough. "\bwhile_each_thread\s*\(" and 12-digit commit id sound reasonable, thanks. I'll update the patch. -- Sergey Dyasly -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: add check for the buggy while_each_thread()
On Sun, 18 Jan 2015 17:27:33 -0800 Joe Perches j...@perches.com wrote: On Sun, 2015-01-18 at 17:24 +0300, Sergey Dyasly wrote: Now it's preferable to use for_each_thread() instead of while_each_thread(). Add a check to checkpatch.pl in order to prevent any new usages of the buggy while_each_thread() when possible. [] diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] @@ -3255,6 +3255,12 @@ sub process { Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n . $herecurr); } +# Check for the buggy while_each_thread() + if ($line =~ /\bwhile_each_thread\(/) { \bwhile_each_thread\s*\( or maybe \bwhile_each_thread\b + WARN(WHILE_EACH_THREAD, +Prefer to use for_each_thread() instead of the buggy while_each_thread(). See commit 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n . $herecurr); Pretty long commit id, 12 is probably enough. \bwhile_each_thread\s*\( and 12-digit commit id sound reasonable, thanks. I'll update the patch. -- Sergey Dyasly dse...@gmail.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: add check for the buggy while_each_thread()
On Sun, 2015-01-18 at 17:24 +0300, Sergey Dyasly wrote: > Now it's preferable to use for_each_thread() instead of while_each_thread(). > Add a check to checkpatch.pl in order to prevent any new usages of the buggy > while_each_thread() when possible. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3255,6 +3255,12 @@ sub process { >"Prefer dev_$level(... to dev_printk(KERN_$orig, > ...\n" . $herecurr); > } > > +# Check for the buggy while_each_thread() > + if ($line =~ /\bwhile_each_thread\(/) { \bwhile_each_thread\s*\( or maybe \bwhile_each_thread\b > + WARN("WHILE_EACH_THREAD", > + "Prefer to use for_each_thread() instead of the > buggy while_each_thread(). See commit > 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n" . $herecurr); Pretty long commit id, 12 is probably enough. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] checkpatch: add check for the buggy while_each_thread()
Now it's preferable to use for_each_thread() instead of while_each_thread(). Add a check to checkpatch.pl in order to prevent any new usages of the buggy while_each_thread() when possible. Cc: Oleg Nesterov Cc: Andy Whitcroft Cc: Joe Perches Signed-off-by: Sergey Dyasly --- scripts/checkpatch.pl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0bb6d6..0c5cc0b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3255,6 +3255,12 @@ sub process { "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); } +# Check for the buggy while_each_thread() + if ($line =~ /\bwhile_each_thread\(/) { + WARN("WHILE_EACH_THREAD", +"Prefer to use for_each_thread() instead of the buggy while_each_thread(). See commit 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n" . $herecurr); + } + # function brace can't be on same line, except for #defines of do while, # or if closed on same line if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and -- 2.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] checkpatch: add check for the buggy while_each_thread()
On Sun, 2015-01-18 at 17:24 +0300, Sergey Dyasly wrote: Now it's preferable to use for_each_thread() instead of while_each_thread(). Add a check to checkpatch.pl in order to prevent any new usages of the buggy while_each_thread() when possible. [] diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] @@ -3255,6 +3255,12 @@ sub process { Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n . $herecurr); } +# Check for the buggy while_each_thread() + if ($line =~ /\bwhile_each_thread\(/) { \bwhile_each_thread\s*\( or maybe \bwhile_each_thread\b + WARN(WHILE_EACH_THREAD, + Prefer to use for_each_thread() instead of the buggy while_each_thread(). See commit 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n . $herecurr); Pretty long commit id, 12 is probably enough. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] checkpatch: add check for the buggy while_each_thread()
Now it's preferable to use for_each_thread() instead of while_each_thread(). Add a check to checkpatch.pl in order to prevent any new usages of the buggy while_each_thread() when possible. Cc: Oleg Nesterov o...@redhat.com Cc: Andy Whitcroft a...@canonical.com Cc: Joe Perches j...@perches.com Signed-off-by: Sergey Dyasly dse...@gmail.com --- scripts/checkpatch.pl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0bb6d6..0c5cc0b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3255,6 +3255,12 @@ sub process { Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n . $herecurr); } +# Check for the buggy while_each_thread() + if ($line =~ /\bwhile_each_thread\(/) { + WARN(WHILE_EACH_THREAD, +Prefer to use for_each_thread() instead of the buggy while_each_thread(). See commit 0c740d0afc3bff0a097ad03a1c8df92757516f5c for details.\n . $herecurr); + } + # function brace can't be on same line, except for #defines of do while, # or if closed on same line if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and -- 2.2.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/