From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH 3/3] can: af_can: fix sparse warning for can_rx_alldev_list
Date: Wed, 20 Jun 2012 05:39:59 +0200 [thread overview]
Message-ID: <4FE1460F.8040409@hartkopp.net> (raw)
In-Reply-To: <1340136320-30840-4-git-send-email-mkl@pengutronix.de>
On 19.06.2012 22:05, Marc Kleine-Budde wrote:
> Make can_rx_alldev_list static to fix the following sparse warning:
> net/can/af_can.c:80:22: warning: symbol 'can_rx_alldev_list' was not
> declared. Should it be static?
>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> net/can/af_can.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/can/af_can.c b/net/can/af_can.c
> index 821022a..ccef846 100644
> --- a/net/can/af_can.c
> +++ b/net/can/af_can.c
> @@ -78,7 +78,7 @@ module_param(stats_timer, int, S_IRUGO);
> MODULE_PARM_DESC(stats_timer, "enable timer for statistics (default:on)");
>
> /* receive filters subscribed for 'all' CAN devices */
> -struct dev_rcv_lists can_rx_alldev_list;
> +static struct dev_rcv_lists can_rx_alldev_list;
> static DEFINE_SPINLOCK(can_rcvlists_lock);
>
> static struct kmem_cache *rcv_cache __read_mostly;
Hello Marc,
did you already compile this?
can_rx_alldev_list is used in af_can.c and proc.c :
$ grep can_rx_alldev_list *.c
af_can.c:struct dev_rcv_lists can_rx_alldev_list;
af_can.c: return &can_rx_alldev_list;
af_can.c: matches = can_rcv_filter(&can_rx_alldev_list, skb);
af_can.c: memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
proc.c:extern struct dev_rcv_lists can_rx_alldev_list;
proc.c: d = &can_rx_alldev_list;
proc.c: d = &can_rx_alldev_list;
So i wonder if making it static inside af_can.c is a good idea.
Is there no way to satisfy the sparse warning in another way?
Regards,
Oliver
next prev parent reply other threads:[~2012-06-20 3:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-19 20:05 [PATCH 0/3] sparse fixes Marc Kleine-Budde
2012-06-19 20:05 ` [PATCH 1/3] can: cc770: fix sparse warning for cc770_interrupt Marc Kleine-Budde
2012-06-19 20:05 ` [PATCH 2/3] can: dev: fix sparse warning for can_restart Marc Kleine-Budde
2012-06-19 20:05 ` [PATCH 3/3] can: af_can: fix sparse warning for can_rx_alldev_list Marc Kleine-Budde
2012-06-20 3:39 ` Oliver Hartkopp [this message]
2012-06-20 8:00 ` Marc Kleine-Budde
2012-06-20 15:46 ` Oliver Hartkopp
2012-06-20 16:05 ` Marc Kleine-Budde
2012-06-20 16:06 ` Oliver Hartkopp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FE1460F.8040409@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.