From: David Miller <davem@davemloft.net>
To: ramirose@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-2.6.25] [BRIDGE] Remove useless code in net/bridge/br_netfilter.c
Date: Tue, 01 Jan 2008 21:20:26 -0800 (PST) [thread overview]
Message-ID: <20080101.212026.187527188.davem@davemloft.net> (raw)
In-Reply-To: <eb3ff54b0801010248t65d296ccm481202d50fad7c4f@mail.gmail.com>
From: "Rami Rosen" <ramirose@gmail.com>
Date: Tue, 1 Jan 2008 12:48:14 +0200
> These following two commands in br_nf_forward_arp() achieve nothing and
> should be removed; the d variable is not used later in this method:
>
> ...
> struct net_device **d = (struct net_device **)(skb->cb);
> ...
> *d = (struct net_device *)in;
> ...
>
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
It's a pointer dereference assignment, this last line has a
side effect, therefore you can't remove it.
The code is equivalent to:
struct skb_bridge_info {
struct net_device *dev;
};
struct skb_bridge_info *d;
d = (struct skb_bridge_info *) skb->cb;
d->dev = in;
What automated tool showed this as useless to you?
Please correct it's logic so it doesn't mark real side effects like
this as superfluous.
Thanks.
next prev parent reply other threads:[~2008-01-02 5:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-01 10:48 [PATCH net-2.6.25] [BRIDGE] Remove useless code in net/bridge/br_netfilter.c Rami Rosen
2008-01-02 5:20 ` David Miller [this message]
2008-01-02 6:16 ` Rami Rosen
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=20080101.212026.187527188.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ramirose@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox