Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 5 | # DESCR: Check that no symbol #defined in any romstage.c is used elsewhere |
| 6 | |
Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 7 | DEFINES=`grep "#define" src/mainboard/*/*/romstage.c |sed 's,.*#define[\t ]\([^\t ]*\)[\t ].*,\1,' | grep -v "(" | sort -u` |
Zheng Bao | 533bca8 | 2012-09-28 19:38:37 +0800 | [diff] [blame] | 8 | SCANBUCKET=`mktemp .tmpconfig.lint001XXXXX` |
Patrick Georgi | 558362f | 2010-11-18 14:33:02 +0000 | [diff] [blame] | 9 | LC_ALL=C export LC_ALL |
| 10 | find src -name .svn -type d -prune -o -name mainboard -type d -prune -o -name examples -type d -prune -o -type f -exec sed -nf `dirname $0`/remccoms3.sed {} + > $SCANBUCKET |
Patrick Georgi | 472efa6 | 2012-02-16 20:44:20 +0100 | [diff] [blame] | 11 | |
Patrick Georgi | e85e0c7c | 2010-11-12 09:46:30 +0000 | [diff] [blame] | 12 | for define in $DEFINES; do |
| 13 | 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 |
| 14 | echo "$define is defined in mainboard(s) and used elsewhere" |
| 15 | fi |
| 16 | done |
| 17 | |
| 18 | rm -f $SCANBUCKET |