[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <493EA286.7080500@gmail.com>
Date: Tue, 09 Dec 2008 17:53:26 +0100
From: Roel Kluin <roel.kluin@...il.com>
To: lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH 0/33] Make static
Hi,
The following patches make things static, found by sparse. They are only used in
the file where they are declared.
I first compiled the kernel using sparse. and piped output to
../logs/make_yes_log_20081203155529
Then I used the script below, but made some manual changes as well. I tested
changes with checkpatch, have built it successfully with allnoconfig,
allmodconfig and allyesconfig.
Thanks,
Roel
Q="[^[:alnum:]_]"
s="[[:space:]]+"
V="[A-Za-z_]+[A-Za-z0-9_]*"
grep "Should it be static\?" ../logs/make_yes_log_20081203155529 |
sed -rn "s/^([^:]*):([^:]*):.*'($V)'.*$/\1 \2 \3/p" | while read f n v; do
echo "---[ v $f:$n $v ]---"
f2="$(git grep -l -E "(^|$Q)$v($Q|$)")"
z=$(echo "$f2" | wc -l)
if [ $z -eq 1 ]; then
echo "$v can be static: v $f:$n"
sed -r -i "${n}s/^(static$S)*(.*)$/static \2/" "$f"
elif [ $z -lt 5 ]; then
grep -E -n "(^|$Q)$v($Q|$)" $(echo $f2 | tr "\n" " ");
echo "if this can be static then apply:"
echo "sed -r -i \"${n}s/^(static$S)*(.*)$/static \2/\" \"$f\"";
fi
done | less
--
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