From: David Miller <davem@davemloft.net>
To: sasikanth.v19@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Removed unnecessary assignments , gotos and goto labels
Date: Thu, 05 May 2011 11:00:36 -0700 (PDT) [thread overview]
Message-ID: <20110505.110036.115954748.davem@davemloft.net> (raw)
In-Reply-To: <1304187809-7887-1-git-send-email-sasikanth.v19@gmail.com>
From: Sasikanth V <sasikanth.v19@gmail.com>
Date: Sat, 30 Apr 2011 23:53:29 +0530
> @@ -1779,15 +1770,15 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
> sll->sll_ifindex = po->ifindex;
> sll->sll_protocol = po->num;
> sll->sll_pkttype = 0;
> + sll->sll_hatype = 0;
> + sll->sll_halen = 0;
> +
> rcu_read_lock();
> dev = dev_get_by_index_rcu(sock_net(sk), po->ifindex);
> if (dev) {
> sll->sll_hatype = dev->type;
> sll->sll_halen = dev->addr_len;
> memcpy(sll->sll_addr, dev->dev_addr, dev->addr_len);
> - } else {
> - sll->sll_hatype = 0; /* Bad: we have no ARPHRD_UNSPEC */
> - sll->sll_halen = 0;
> }
> rcu_read_unlock();
This is completely bogus.
In the dev != NULL case, we'll now write to sll_hatype and sll_halen
twice, which is less inefficient than making sure we write to these
fields only one.
And outside of this part, I really don't like the cleanups you made
here, and they don't improve the code in any way in my eyes.
Sorry.
prev parent reply other threads:[~2011-05-05 18:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 18:23 [PATCH] Removed unnecessary assignments , gotos and goto labels Sasikanth V
2011-05-05 18:00 ` David Miller [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=20110505.110036.115954748.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sasikanth.v19@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;
as well as URLs for NNTP newsgroup(s).