From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755244AbbIHQxO (ORCPT ); Tue, 8 Sep 2015 12:53:14 -0400 Received: from smtprelay0055.hostedemail.com ([216.40.44.55]:50914 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754664AbbIHQxM (ORCPT ); Tue, 8 Sep 2015 12:53:12 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3350:3622:3865:3866:3868:3871:3872:4321:5007:6261:10004:10400:10848:11232:11657:11658:11914:12043:12296:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: pail15_1bb6e34ffea39 X-Filterd-Recvd-Size: 1721 Message-ID: <1441731189.17219.1.camel@perches.com> Subject: Re: [PATCH 2/2] staging: lustre: lov: remove always false condition From: Joe Perches To: Sudip Mukherjee Cc: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org Date: Tue, 08 Sep 2015 09:53:09 -0700 In-Reply-To: <1441729382-27865-2-git-send-email-sudipm.mukherjee@gmail.com> References: <1441729382-27865-1-git-send-email-sudipm.mukherjee@gmail.com> <1441729382-27865-2-git-send-email-sudipm.mukherjee@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-09-08 at 21:53 +0530, Sudip Mukherjee wrote: > The member qc_idx of struct if_quotactl is unsigned and hence it can > never be less than zero. [] > diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c [] > @@ -1487,7 +1487,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, > struct obd_quotactl *oqctl; > > if (qctl->qc_valid == QC_OSTIDX) { > - if (qctl->qc_idx < 0 || count <= qctl->qc_idx) > + if (count <= qctl->qc_idx) Perhaps this test would be clearer reversed too if (qctl->qc_idx >= count) > return -EINVAL;