Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758190AbcCVCCU (ORCPT ); Mon, 21 Mar 2016 22:02:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59277 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754062AbcCVCCT (ORCPT ); Mon, 21 Mar 2016 22:02:19 -0400 Date: Mon, 21 Mar 2016 22:02:17 -0400 From: Greg KH To: Claudiu Beznea Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call Message-ID: <20160322020217.GA24033@kroah.com> References: <1458071595-22365-1-git-send-email-claudiu.beznea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458071595-22365-1-git-send-email-claudiu.beznea@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 504 Lines: 13 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