Re: [PATCH] checkpatch: Add test for possible misuse of IS_ENABLED() without CONFIG_

2020-06-06 Thread Joe Perches
Might s well post one that works Interdiff similar to: + if ($sym !~ /^CONFIG_/) { + WARN("IS_ENABLED_CONFIG", + "IS_ENABLED($sym) is normally used as IS_ENABLED(CONFIG_$1)\n" . $herecurr); ++

Re: [PATCH] checkpatch: Add test for possible misuse of IS_ENABLED() without CONFIG_

2020-06-05 Thread Joe Perches
On Fri, 2020-06-05 at 17:32 -0700, Andrew Morton wrote: > On Fri, 05 Jun 2020 11:24:43 -0700 Joe Perches wrote: > > > IS_ENABLED is almost always used with CONFIG_ defines. > > > > Add a test to verify that the #define being tested starts with CONFIG_. > > Yay. > > I wonder if there's a

Re: [PATCH] checkpatch: Add test for possible misuse of IS_ENABLED() without CONFIG_

2020-06-05 Thread Andrew Morton
On Fri, 05 Jun 2020 11:24:43 -0700 Joe Perches wrote: > IS_ENABLED is almost always used with CONFIG_ defines. > > Add a test to verify that the #define being tested starts with CONFIG_. Yay. I wonder if there's a simple way of testing whether the CONFIG_ thing can *ever* be enabled. So

Re: [PATCH] checkpatch: Add test for possible misuse of IS_ENABLED() without CONFIG_

2020-06-05 Thread Kees Cook
On Fri, Jun 05, 2020 at 11:24:43AM -0700, Joe Perches wrote: > IS_ENABLED is almost always used with CONFIG_ defines. > > Add a test to verify that the #define being tested starts with CONFIG_. > > Signed-off-by: Joe Perches Reviewed-by: Kees Cook -- Kees Cook

[PATCH] checkpatch: Add test for possible misuse of IS_ENABLED() without CONFIG_

2020-06-05 Thread Joe Perches
IS_ENABLED is almost always used with CONFIG_ defines. Add a test to verify that the #define being tested starts with CONFIG_. Signed-off-by: Joe Perches --- scripts/checkpatch.pl | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index