mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
checkpatch.pl: Request if() instead #ifdef
There is a lot of use of #ifdefs in U-Boot. In an effort reduce this, suggest using the compile-time construct. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
58978114d9
commit
dd5b0fad8f
1 changed files with 6 additions and 0 deletions
|
@ -2261,6 +2261,12 @@ sub u_boot_line {
|
|||
WARN("CMD_TEST",
|
||||
"Possible new command - make sure you add a test\n" . $herecurr);
|
||||
}
|
||||
|
||||
# use if instead of #if
|
||||
if ($line =~ /^\+#if.*CONFIG.*/) {
|
||||
WARN("PREFER_IF",
|
||||
"Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
|
||||
sub process {
|
||||
|
|
Loading…
Add table
Reference in a new issue