public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 13/33] Input: Make static
@ 2008-12-20 10:50 Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2008-12-20 10:50 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-input, lkml

On Tuesday 09 December 2008 10:44:41 Roel Kluin wrote:
> Sparse asked whether these could be static.
>

Applied to 'next' branch, thank you Roel.

-- 
Dmitry


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 0/33] Make static
@ 2008-12-09 16:53 Roel Kluin
  2008-12-09 18:44 ` [PATCH 13/33] Input: " Roel Kluin
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2008-12-09 16:53 UTC (permalink / raw)
  To: lkml

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-20 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-20 10:50 [PATCH 13/33] Input: Make static Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2008-12-09 16:53 [PATCH 0/33] " Roel Kluin
2008-12-09 18:44 ` [PATCH 13/33] Input: " Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox