checkpatch: Add check for gpiomux usage in msm board files

MSM has a board-*-gpiomux file where all the gpiomux configs reside.
Warn if a non gpiomux board file tries to add gpiomux configs.
The camera board file is an exception to this rule.

Change-Id: Ibab190dcbd7ea78e7ca150142c68c5ae881e4e06
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
This commit is contained in:
Rohit Vaswani
2011-12-06 20:03:07 -08:00
parent 952a1d10fd
commit 60d78bb980

View File

@@ -2784,6 +2784,13 @@ sub process {
$herecurr); $herecurr);
} }
# MSM - check if a non board-gpiomux file has any gpiomux declarations
if ($realfile =~ /\/mach-msm\/board-[0-9]+/ &&
$realfile !~ /camera/ && $realfile !~ /gpiomux/ &&
$line =~ /\s*struct msm_gpiomux_config\s*/ ) {
WARN("Non gpiomux board file cannot have a gpiomux config declarations. Please declare gpiomux configs in board-*-gpiomux.c file.\n" . $herecurr);
}
# unbounded string functions are overflow risks # unbounded string functions are overflow risks
my %str_fns = ( my %str_fns = (
"sprintf" => "snprintf", "sprintf" => "snprintf",