Return-path: Received: from mout.gmx.net ([212.227.15.19]:56439 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756748AbcG1LqA (ORCPT ); Thu, 28 Jul 2016 07:46:00 -0400 MIME-Version: 1.0 Message-ID: (sfid-20160728_134640_866494_C7A92B84) From: "Lino Sanfilippo" To: "SF Markus Elfring" Cc: LKML , kernel-janitors@vger.kernel.org, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, "Greg Kroah-Hartman" , "Steve Caldwell" Subject: Aw: Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl() Content-Type: text/plain; charset=UTF-8 Date: Thu, 28 Jul 2016 13:45:34 +0200 In-Reply-To: References: <1c4cac35-dded-ea88-45aa-3f8ac098289d@gmx.de>, Sender: linux-wireless-owner@vger.kernel.org List-ID: > Gesendet: Dienstag, 26. Juli 2016 um 08:25 Uhr > Von: "SF Markus Elfring" > > >> - if (strncasecmp(buff, "RSSI", length) == 0) { > >> + if (strncasecmp(buff, "RSSI", 0) == 0) { > >> + s8 rssi; > >> + > > > > Um, please think a second about if it makes any sense at all to compare > > zero chars of two strings. > > Under which circumstances should the variable "length" contain an other > value than zero? Which circumstances do "not any sense at all" imply? > > How can this open issue be fixed better? The code is not too complicated and I think it is very obvious which value/variable should be passed instead of 0. I suggest to fix this since it is indeed a bug, instead of doing "micro optimizations" - which is the last thing that code in the staging area needs (as IIRC you have already been told by others, including the staging maintainer). Regards, Lino