Received: by 10.192.165.148 with SMTP id m20csp2709561imm; Sun, 6 May 2018 22:56:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqNd9VEKgzhwSsEyiL+M2SfFldQZRXzLO9OUpHFtAjIIgYK/Z7QTSTnVngnrS/RDFrM6U8o X-Received: by 2002:a63:6012:: with SMTP id u18-v6mr24111504pgb.284.1525672592788; Sun, 06 May 2018 22:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525672592; cv=none; d=google.com; s=arc-20160816; b=WkKqr7xIvmBO8rgt/ql6hkuZ48Uj3ZAqsibZotiLrPx6UrzL0SSHNTl+nN99wAFCR6 b8i5SSJ2C4z090yzPlYYhgqPA9dpBLlCuR+/YCG1Ufh/fATJafQCJKzCYh5lncd4z1ou i3gl3dJa2cfhQgJHS82mjMexmdYAl0bDJLdz7b3UfjQq5+dksER4SmUAdKhaMTd63h9v 3MRBfusU5uke9Y59lPDMMm9yPyFb5OApiGPphB9kS4d+WbUEJzykyUDoLi2UaINsMOao a4sLcSwvlU4t6Bu2B/o3G0ZBbxBJZr7K8TxdJph6NxZvaPEs3EJLZAgT1te9a4/6clzl cAdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=aXsLPjdBGgeooEP2JT7YC6zCix0fhhh/FlGKBDqQ4ZA=; b=wk6Lu5R03zSvh8VtZcMueI2reOC/e3zGbsT35DbgSFdJrW4buwVxAWYsrbTuhJVdZm dV9KHQavk2a0sMV3pZpKnIVJPGu5lkswX2wQ0OfTvt4ZM1EmEtrnI1Z4T1ooWtLsx6KT FPtzKwN4aHenV4MCZ5HzD1/v+cM+BEZ9DezQmIW9vtVtIAXPA9IH0+8zOOXwPwCyd9k7 Oqklim5g7n1clVBngsig+KIsVvqcn7XnRIj4izmsEvG7DrySUzUbV00d1AUQJdWVV5ud UM2LKyMrCcrnImyi6NmIlgJkWgTc4VM19u2GSo4B1QL1WcYV6pbkwhoWXjQWA8y/+Xzn MwWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si12808816pgv.424.2018.05.06.22.56.18; Sun, 06 May 2018 22:56:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751925AbeEGFze (ORCPT + 99 others); Mon, 7 May 2018 01:55:34 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:8846 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbeEGFzd (ORCPT ); Mon, 7 May 2018 01:55:33 -0400 X-IronPort-AV: E=Sophos;i="5.49,372,1520924400"; d="scan'208";a="13957706" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 May 2018 22:55:33 -0700 Received: from ajaysk-VirtualBox (10.10.76.4) by chn-sv-exch06.mchp-main.com (10.10.76.107) with Microsoft SMTP Server id 14.3.352.0; Sun, 6 May 2018 22:55:32 -0700 Date: Mon, 7 May 2018 11:25:27 +0530 From: Ajay Singh To: Nathan Chancellor CC: , Greg Kroah-Hartman , , , Ganesh Krishna , Aditya Shankar Subject: Re: [PATCH 3/3] staging: wilc1000: Remove unnecessary array index check Message-ID: <20180507112527.0037a95e@ajaysk-VirtualBox> In-Reply-To: <20180506073333.3770-3-natechancellor@gmail.com> References: <20180506073333.3770-1-natechancellor@gmail.com> <20180506073333.3770-3-natechancellor@gmail.com> Organization: Microchip Technology X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 6 May 2018 00:33:33 -0700 Nathan Chancellor wrote: > This statment triggers GCC's -Wtype-limit since key_index is an > unsigned integer so it cannot be less than zero. > > Signed-off-by: Nathan Chancellor Reviewed-by: Ajay Singh > --- > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index > b499fb987395..e0015ca6c21a 100644 --- > a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ > b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1054,7 > +1054,7 @@ static int del_key(struct wiphy *wiphy, struct net_device > *netdev, } } > > - if (key_index >= 0 && key_index <= 3 && > priv->wep_key_len[key_index]) { > + if (key_index <= 3 && priv->wep_key_len[key_index]) { > memset(priv->wep_key[key_index], 0, > priv->wep_key_len[key_index]); > priv->wep_key_len[key_index] = 0;