Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ea9add6 authored by Rohit Vaswani's avatar Rohit Vaswani Committed by Kyle Yan
Browse files

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: default avatarRohit Vaswani <rvaswani@codeaurora.org>
(cherry picked from commit 60d78bb9809e7d4d1c3dc1425cbfd9e649e87c1c)
Signed-off-by: default avatarStepan Moskovchenko <stepanm@codeaurora.org>
parent 41aaf689
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5021,6 +5021,14 @@ sub process {
			     $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("GPIOMUX_IN_BOARD",
		     "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
		my %str_fns = (
			"sprintf" => "snprintf",