Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362275

Re: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call
Date 2016-03-22 03:10 +0100
Message-ID <rfjVD-67W-3@gated-at.bofh.it> (permalink)
References <rd3ii-6Hm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 15, 2016 at 09:53:15PM +0200, Claudiu Beznea wrote:
> This patch moves memset() calls from p80211netdev_ethtool()
> after copy_from_user() call in order to avoid unnecessary
> instruction in case copy_from_user() fails.

Does that really matter?  If an error happens, then we are on a "slow
path" and the extra memset didn't matter at all.  Don't move code around
for no good reason, and if you think it makes things faster, then you
have to be able to prove it somehow :)

thanks,

greg k-h

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] Staging: wlan-ng: moved memset() calls after  copy_from_user() call Greg KH <gregkh@linuxfoundation.org> - 2016-03-22 03:10 +0100
  Re: [PATCH] Staging: wlan-ng: moved memset() calls after  copy_from_user() call Greg KH <gregkh@linuxfoundation.org> - 2016-03-22 14:30 +0100

csiph-web