checkpatch: add check for keyword 'boolean' in Kconfig definitions
PATCH 1/1 checkpatch: add check for keyword 'boolean' in Kconfig definitions
Discourage the use of keyword 'boolean' for type definition attributes of config options as support for it will be dropped later on.
Reference: http://lkml.kernel.org/r/[email protected]
--- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+)
scripts/checkpatch.pl +7 -0
@@ -2355,6 +2355,13 @@ sub process { "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n"); } +# discourage the use of boolean for type definition attributes of Kconfig options + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bboolean\b/) { + WARN("CONFIG_TYPE_BOOLEAN", + "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); + } + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { my $flag = $1;
Signature · 1 line
2.1.0
Joe Perches
maintainer(adding Andrew Morton)
Quoted 6 lines · Christoph Jaeger
Discourage the use of keyword 'boolean' for type definition attributes of config options as support for it will be dropped later on.
Reference: http://lkml.kernel.org/r/[email protected]
Suggested-by Daniel Borkmann <[email protected]>Signed-off-by Christoph Jaeger <[email protected]>
Seems sensible.
Quoted 22 lines
--- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+)scripts/checkpatch.pl +7
-0@@ -2355,6 +2355,13 @@ sub process { "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n"); } +# discourage the use of boolean for type definition attributes of Kconfig options + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bboolean\b/) { + WARN("CONFIG_TYPE_BOOLEAN", + "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); + } + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { my $flag = $1;
Quoted 6 lines · Christoph Jaeger
Discourage the use of keyword 'boolean' for type definition attributes of config options as support for it will be dropped later on.
Reference: http://lkml.kernel.org/r/[email protected]
Suggested-by Daniel Borkmann <[email protected]>Signed-off-by Christoph Jaeger <[email protected]>
Works as advertised:
$ scripts/checkpatch.pl -f kernel/livepatch/Kconfig
WARNING: Use of boolean is deprecated, please use bool instead.
#2: FILE: kernel/livepatch/Kconfig:2:
+ boolean WARNING: Use of boolean is deprecated, please use bool instead. #7: FILE: kernel/livepatch/Kconfig:7:
+ boolean "Kernel Live Patching"
total: 0 errors, 2 warnings, 18 lines checked
kernel/livepatch/Kconfig has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Quoted 9 lines
--- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+)scripts/checkpatch.pl +0
-0
scripts/checkpatch.pl sub process { · line 2361
Quoted 7 lines
scripts/checkpatch.pl +4
-0@@ -2355,6 +2355,13 @@ sub process { "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n"); } +# discourage the use of boolean for type definition attributes of Kconfig options + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bboolean\b/) { + WARN("CONFIG_TYPE_BOOLEAN",
This should become an error once "boolean" is removed (on some future date).
scripts/checkpatch.pl sub process { · line 2367
Quoted 6 lines
scripts/checkpatch.pl +3
-0+ "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); + } + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { my $flag = $1;
Paul Bolle