From: Randy Dunlap <randy.dunlap@oracle.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH -next] bridge: fix build for CONFIG_SYSFS disabled
Date: Mon, 17 May 2010 11:01:12 -0700 [thread overview]
Message-ID: <4BF18468.5010005@oracle.com> (raw)
In-Reply-To: <20100517105654.2451e61f@nehalam>
On 05/17/10 10:56, Stephen Hemminger wrote:
> On Mon, 17 May 2010 09:17:56 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> Fix build when CONFIG_SYSFS is not enabled:
>>
>> net/bridge/br_if.c:136: error: 'struct net_bridge_port' has no member named 'sysfs_name'
>>
>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>> ---
>> net/bridge/br_if.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> --- linux-next-20100517.orig/net/bridge/br_if.c
>> +++ linux-next-20100517/net/bridge/br_if.c
>> @@ -133,7 +133,9 @@ static void del_nbp(struct net_bridge_po
>> struct net_bridge *br = p->br;
>> struct net_device *dev = p->dev;
>>
>> +#ifdef CONFIG_SYSFS
>> sysfs_remove_link(br->ifobj, p->sysfs_name);
>> +#endif
>>
>> dev_set_promiscuity(dev, -1);
>>
>
> I don't like peppering code with #ifdef like this.
Thanks. I didn't like it either.
> Turns out that in this place sysfs_name is always the same
> as the device name so instead:
>
>
> --- a/net/bridge/br_if.c 2010-05-17 10:40:49.808031840 -0700
> +++ b/net/bridge/br_if.c 2010-05-17 10:49:47.767669246 -0700
> @@ -133,7 +133,7 @@ static void del_nbp(struct net_bridge_po
> struct net_bridge *br = p->br;
> struct net_device *dev = p->dev;
>
> - sysfs_remove_link(br->ifobj, p->sysfs_name);
> + sysfs_remove_link(br->ifobj, p->dev->name);
>
> dev_set_promiscuity(dev, -1);
>
>
>
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2010-05-17 18:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-17 6:35 linux-next: Tree for May 17 Stephen Rothwell
2010-05-17 16:16 ` [PATCH -next] pcmciamtd: fix printk format warnings Randy Dunlap
2010-05-17 16:16 ` Randy Dunlap
2010-05-17 18:55 ` David Woodhouse
2010-05-17 18:55 ` David Woodhouse
2010-05-17 16:17 ` [PATCH -next] bridge: fix build for CONFIG_SYSFS disabled Randy Dunlap
2010-05-17 17:56 ` Stephen Hemminger
2010-05-17 18:01 ` Randy Dunlap [this message]
2010-05-18 5:32 ` David Miller
2010-05-18 17:28 ` Stephen Hemminger
2010-05-18 19:26 ` David Miller
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=4BF18468.5010005@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=shemminger@vyatta.com \
/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.