All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: YUAN Linyu <Linyu.Yuan@alcatel-sbell.com.cn>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC] networking: convert many more places to skb_put_zero()
Date: Thu, 15 Jun 2017 09:11:56 +0200	[thread overview]
Message-ID: <1497510716.2518.4.camel@sipsolutions.net> (raw)
In-Reply-To: <8729016553E3654398EA69218DA29EEF15BC8EFC@cnshjmbx02>

On Thu, 2017-06-15 at 07:05 +0000, YUAN Linyu wrote:
> > @@
> > type t;
> > expression skb, len;
> > identifier p;
> > @@
> > t *p
> > - = skb_put(skb, len);
> > + = skb_put_zero(skb, len);
> > -memset(p, 0, len);
> > 
> > and it can't figure out that it should remove the variable, without
> > much more work that's not really worth it for one instance :)
> 
> Yes, I agree, 
> it conflict with previous spatch which will keep "pad" variable,
> right?
> 
> I can do it by hand if spatch not work

I could teach spatch, but it's usually faster (for me) to post-process
the spatch changes to remove the extra variable - in this case though,
it's just not worth it at all since there's just a single change and
you already have a separate patch :)

Btw, just made a patch to add and use "skb_put_data()", just doing a
memcpy() into the skb_put() area also has lots of users.

johannes

  reply	other threads:[~2017-06-15  7:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 20:17 [RFC] networking: convert many more places to skb_put_zero() Johannes Berg
2017-06-15  0:23 ` YUAN Linyu
2017-06-15  6:57   ` Johannes Berg
2017-06-15  7:05     ` YUAN Linyu
2017-06-15  7:11       ` Johannes Berg [this message]
2017-06-15  7:20         ` YUAN Linyu
2017-06-15  7:45           ` Johannes Berg
2017-06-15  7:47             ` YUAN Linyu

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=1497510716.2518.4.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=Linyu.Yuan@alcatel-sbell.com.cn \
    --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 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.