* 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* [PATCH 13/33] Input: Make static
2008-12-09 16:53 [PATCH 0/33] " Roel Kluin
@ 2008-12-09 18:44 ` Roel Kluin
0 siblings, 0 replies; 2+ messages in thread
From: Roel Kluin @ 2008-12-09 18:44 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input, lkml
Sparse asked whether these could be static.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/input/mouse/gpio_mouse.c | 2 +-
drivers/input/tablet/wacom_wac.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index 72cf5e3..0db8d16 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -173,7 +173,7 @@ static int __devexit gpio_mouse_remove(struct platform_device *pdev)
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:gpio_mouse");
-struct platform_driver gpio_mouse_device_driver = {
+static struct platform_driver gpio_mouse_device_driver = {
.remove = __devexit_p(gpio_mouse_remove),
.driver = {
.name = "gpio_mouse",
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 8dc8d1e..2638811 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -535,7 +535,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
return 1;
}
-int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo)
+static int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo)
{
char *data = wacom->data;
int prox = 0, pressure;
^ permalink raw reply related [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