summaryrefslogtreecommitdiff
path: root/util/lint/lint-001-no-global-config-in-romstage
diff options
context:
space:
mode:
Diffstat (limited to 'util/lint/lint-001-no-global-config-in-romstage')
-rw-r--r--util/lint/lint-001-no-global-config-in-romstage12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/lint/lint-001-no-global-config-in-romstage b/util/lint/lint-001-no-global-config-in-romstage
new file mode 100644
index 0000000000..095cbcebab
--- /dev/null
+++ b/util/lint/lint-001-no-global-config-in-romstage
@@ -0,0 +1,12 @@
+#!/bin/sh
+DEFINES=`grep "#define" src/mainboard/*/*/romstage.c |sed 's,.*#define[\t ]\([^\t ]*\)[\t ].*,\1,' | grep -v "(" | sort -u`
+SCANBUCKET=`mktemp`
+find src -name .svn -type d -prune -o -name mainboard -type d -prune -o -name examples -type d -prune -o -type f -exec sed -f `dirname $0`/remccoms3.sed {} + > $SCANBUCKET
+
+for define in $DEFINES; do
+ if [ `egrep -c "([^_A-Za-z0-9]$define[^_A-Za-z0-9]|^$define[^_A-Za-z0-9]|[^_A-Za-z0-9]$define\$)" $SCANBUCKET` -gt 0 ]; then
+ echo "$define is defined in mainboard(s) and used elsewhere"
+ fi
+done
+
+rm -f $SCANBUCKET