new file mode 100644
@@ -0,0 +1,57 @@
+# Copyright (C) 2010-2012 Canonical
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 path-to-kernel-source"
+ exit 1
+if [ ! -d $1 ]; then
+ echo "Path '$1' not found"
+ exit 1
+ $KERNELSCAN < $1 -E | gcc -E - | $KERNELSCAN -P > $TMP
+ if [ $(stat -c%s $TMP) -gt 0 ]; then
+ echo "Source: $1"
+ cat $TMP
+ rm $TMP
+ echo "Scanning $tree"
+ for I in $(find $tree -name "*.c")
+ scan_source_file $I