2010-01-15 02:10:38

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] hid-debug.c: make local symbols static

hid-debug.c: make local symbols static

The symbols hid_resolv_event and hid_dump_input_mapping
are only used locally in this file. Make them static to prevent
the following sparse warnings:

warning: symbol 'hid_resolv_event' was not declared. Should it be static?
warning: symbol 'hid_dump_input_mapping' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Jiri Kosina <[email protected]>

---

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 6abd036..cd4ece6 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -864,13 +864,13 @@ static const char **names[EV_MAX + 1] = {
[EV_SND] = sounds, [EV_REP] = repeats,
};

-void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f) {
-
+static void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f)
+{
seq_printf(f, "%s.%s", events[type] ? events[type] : "?",
names[type] ? (names[type][code] ? names[type][code] : "?") : "?");
}

-void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
+static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
{
int i, j, k;
struct hid_report *report;


2010-01-15 10:36:28

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] hid-debug.c: make local symbols static

On Thu, 14 Jan 2010, H Hartley Sweeten wrote:

> hid-debug.c: make local symbols static
>
> The symbols hid_resolv_event and hid_dump_input_mapping
> are only used locally in this file. Make them static to prevent
> the following sparse warnings:
>
> warning: symbol 'hid_resolv_event' was not declared. Should it be static?
> warning: symbol 'hid_dump_input_mapping' was not declared. Should it be static?
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Jiri Kosina <[email protected]>
>
> ---
>
> diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
> index 6abd036..cd4ece6 100644
> --- a/drivers/hid/hid-debug.c
> +++ b/drivers/hid/hid-debug.c
> @@ -864,13 +864,13 @@ static const char **names[EV_MAX + 1] = {
> [EV_SND] = sounds, [EV_REP] = repeats,
> };
>
> -void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f) {
> -
> +static void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f)
> +{
> seq_printf(f, "%s.%s", events[type] ? events[type] : "?",
> names[type] ? (names[type][code] ? names[type][code] : "?") : "?");
> }
>
> -void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
> +static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
> {
> int i, j, k;
> struct hid_report *report;

Applied, thanks.

--
Jiri Kosina
SUSE Labs, Novell Inc.