From: "Rami Rosen" <ramirose@gmail.com>
To: "David Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-2.6.25] [BRIDGE] Remove useless code in net/bridge/br_netfilter.c
Date: Wed, 2 Jan 2008 08:16:54 +0200 [thread overview]
Message-ID: <eb3ff54b0801012216r486ba195p127d9f9102143c84@mail.gmail.com> (raw)
In-Reply-To: <20080101.212026.187527188.davem@davemloft.net>
Hi,
> It's a pointer dereference assignment,
Sorry, I was wrong here !
> 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.
I am not using any automated tool, only my eyes. And I
missed the intention here. It could be implemnted differently
but since it not marked as superfluous anywhere I suggest
to leave it as it is.
Sorry,
Regards,
Rami Rosen
On Jan 2, 2008 7:20 AM, David Miller <davem@davemloft.net> wrote:
> 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.
>
prev parent reply other threads:[~2008-01-02 6:16 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
2008-01-02 6:16 ` Rami Rosen [this message]
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=eb3ff54b0801012216r486ba195p127d9f9102143c84@mail.gmail.com \
--to=ramirose@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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