netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, johannes.berg@intel.com
Subject: Re: [PATCH] netlink: make nlmsg_end() and genlmsg_end() void
Date: Sun, 18 Jan 2015 01:04:46 -0500 (EST)	[thread overview]
Message-ID: <20150118.010446.405197490184285420.davem@davemloft.net> (raw)
In-Reply-To: <1421442540-10244-1-git-send-email-johannes@sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Fri, 16 Jan 2015 22:09:00 +0100

 ...
> Remove this, and make the functions void. This removes a bunch of dead
> code as described above. The patch adds lines because I did
> 
> -	return nlmsg_end(...);
> +	nlmsg_end(...);
> +	return 0;
> 
> I could have preserved all the function's return values by returning
> skb->len, but instead I've audited all the places calling the affected
> functions and found that none cared. A few places actually compared
> the return value with <= 0 in dump functionality, but that could just
> be changed to < 0 with no change in behaviour, so I opted for the more
> efficient version.
> 
> One instance of the error I've made numerous times now is also present
> in net/phonet/pn_netlink.c in the route_dumpit() function - it didn't
> check for <0 or <=0 and thus broke out of the loop every single time.
> I've preserved this since it will (I think) have caused the messages to
> userspace to be formatted differently with just a single message for
> every SKB returned to userspace. It's possible that this isn't needed
> for the tools that actually use this, but I don't even know what they
> are so couldn't test that changing this behaviour would be acceptable.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

I like this, applied, thanks Johannes.

You know, I would even be willing to apply a patch adjusting that phonet
case.  So feel free to submit that.

  reply	other threads:[~2015-01-18  6:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 21:09 [PATCH] netlink: make nlmsg_end() and genlmsg_end() void Johannes Berg
2015-01-18  6:04 ` David Miller [this message]
2015-01-18 13:27   ` Johannes Berg

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=20150118.010446.405197490184285420.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.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;
as well as URLs for NNTP newsgroup(s).