[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1428345795-28255-1-git-send-email-bjorn.andersson@sonymobile.com>
Date: Mon, 6 Apr 2015 11:43:15 -0700
From: Bjorn Andersson <bjorn.andersson@...ymobile.com>
To: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>
CC: <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: validate MODULE_LICENSE content
There is a well defined list of expected values for MODULE_LICENSE so
warn the user upon usage of unknown values.
Signed-off-by: Bjorn Andersson <bjorn.andersson@...ymobile.com>
---
scripts/checkpatch.pl | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..7087b28 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5354,6 +5354,22 @@ sub process {
}
}
}
+
+ if ($line =~ /MODULE_LICENSE\(($String)\)/) {
+ my $extracted_string = get_quoted_string($line, $rawline);
+ my $valid_licenses = qr{
+ GPL|
+ GPL\ v2|
+ GPL\ and\ additional\ rights|
+ Dual\ BSD/GPL|
+ Dual\ MIT/GPL|
+ Dual\ MPL/GPL|
+ Proprietary
+ }x;
+ if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) {
+ WARN("MODULE_LICENSE", "unknown module license " . $extracted_string . "\n" . $herecurr);
+ }
+ }
}
# If we have no input at all, then there is nothing to report on
--
1.8.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists