netdev
[Top] [All Lists]

Re: [PATCH] netlink functions that can be static (trivial)

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [PATCH] netlink functions that can be static (trivial)
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Wed, 28 Apr 2004 12:25:35 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040428104853.229f3d6c@dell_ss3.pdx.osdl.net>
References: <20040428104853.229f3d6c@dell_ss3.pdx.osdl.net>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 28 Apr 2004 10:48:53 -0700
Stephen Hemminger <shemminger@xxxxxxxx> wrote:

> Several internal functions and tables in rtnetlink can be static, and
> fill functions don't change stat of the net_device.

Some problems here...


> -static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
> +static int rtnetlink_fill_ifinfo(struct sk_buff *skb,
> +                              const struct net_device *dev,

It doesn't start as static in my tree, I think you diffed the wrong
revisions in your tree. :-)  We export this thing to modules too, how
do you know some external module doesn't actually use this thing?  I
know of no users, but...

> -     struct net_device *dev;
> +     const struct net_device *dev;

This is wrong, a few lines down we assign it here:

>       read_lock(&dev_base_lock);
>       for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) {

So marking that 'dev' const cannot be right.  Or are you marking the
"object pointed to by 'dev'" as const?

The rest of the patch seems fine, just clean these two things up.
Thanks.

<Prev in Thread] Current Thread [Next in Thread>