Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdFZHRd (ORCPT ); Mon, 26 Jun 2017 03:17:33 -0400 Received: from mail-cys01nam02on0069.outbound.protection.outlook.com ([104.47.37.69]:28896 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751354AbdFZHRX (ORCPT ); Mon, 26 Jun 2017 03:17:23 -0400 From: "Rangankar, Manish" To: Christos Gkekas , Dept-Eng QLogic Storage Upstream , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. Thread-Topic: [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. Thread-Index: AQHS7QaDJS0jvFSfRUadGjW9/1xrAKI3Gp2A Date: Mon, 26 Jun 2017 07:17:19 +0000 Message-ID: References: <1498321485-21677-1-git-send-email-chris.gekas@gmail.com> In-Reply-To: <1498321485-21677-1-git-send-email-chris.gekas@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=cavium.com; x-originating-ip: [116.75.189.226] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN3PR07MB2483;7:ZLd0PJQFax5e1qYRqRNRM1GCVu1Jb0tONEKjKRzoZ0bRmEwDhHGaxugc0fupWFBF8d42HaC/yOwmTWey1CMBH9a44trII14jxhNYh6FitNT/VF8OAexxp6m01o/VYKQGj+eWssLRAoxaOmHCqWCQXxZgDPathH01285CrSMPL0tRlmdxjsVR3YExlJCQVag0+MciBXf24vAfWGatPZU7XrixXamIjQv+YLe64daXDN4X59muE0/1dT5KW88e0iS/+qbtoPb8jkBAfds8ox3vVkHMGqQiOKj74PjgL1yHICWrd6lWpCwaObjX0+b+AdlIcQFTD9/CQiWFy4tIay/Qz31gj2JJMvh86jgCYkp3SpEkg+ORm3ANHqHrrYXvbYHGDZHAUuN9lmdQS+OVfqDMOQmkKKZiBEKyIGBlzJHbo2wrREbnor70THqBsd+f7LGOVoum4mLgH6IE+FtkdHBWKXDYN1ligG3Pf4b7Ip+5eGqUYbfQ47R1o32VdeOejSW+CLjnnjhrZOeN15lDwkTXSpb5wQvVKVOcypzJsMueYCutE8yEjtK3FbyWVJ/jenLH9oidbNcKfm6/RhW/w58S+A5CVefQJiZGaKNTjnBkQCe3vSWeQcFMruANGrPabm1yhWBywdwEh3u1zPZdxUWnXyiju6RPk8xQ/c59HJwo/hJHVxWbSaZYjl5ymwPoUImV2hlkA5HmFKCLHAyUTUkC9YTUpIqA2WrE1WTV7XSzA+DsrERdjf6m32wwljQH69VtJ4K5Kj1LFA22ipn5W832SChQMBNOoFnBeXKNF1INJcA= x-ms-office365-filtering-correlation-id: b058ae80-6ac8-449d-1075-08d4bc636222 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254075)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095);SRVR:BN3PR07MB2483; x-ms-traffictypediagnostic: BN3PR07MB2483: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(236129657087228); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR07MB2483;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR07MB2483; x-forefront-prvs: 0350D7A55D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39400400002)(39850400002)(39840400002)(39450400003)(377454003)(24454002)(2950100002)(53546010)(189998001)(3280700002)(122556002)(3660700001)(8936002)(305945005)(6506006)(25786009)(81156014)(5660300001)(50986999)(2501003)(54356999)(76176999)(6436002)(229853002)(14454004)(99286003)(6486002)(53936002)(6246003)(2906002)(77096006)(102836003)(38730400002)(3846002)(39060400002)(7736002)(6512007)(86362001)(6116002)(66066001)(36756003)(8676002)(81166006)(478600001)(2900100001)(2201001)(72206003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2483;H:BN3PR07MB2483.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2017 07:17:19.8805 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2483 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5Q7Hg5v026347 Content-Length: 1305 Lines: 40 On 24/06/17 9:54 PM, "Christos Gkekas" wrote: >Variable idx is defined as u16 thus statement (idx < 0) is >always false and should be removed. > >Signed-off-by: Christos Gkekas >--- > drivers/scsi/qedi/qedi_fw.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c >index e937490..19254bd 100644 >--- a/drivers/scsi/qedi/qedi_fw.c >+++ b/drivers/scsi/qedi/qedi_fw.c >@@ -333,7 +333,7 @@ static void qedi_get_rq_bdq_buf(struct qedi_ctx *qedi, > > /* Obtain buffer address from rqe_opaque */ > idx = cqe->rqe_opaque.lo; >- if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) { >+ if (idx > (QEDI_BDQ_NUM - 1)) { > QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN, > "wrong idx %d returned by FW, dropping the unsolicited pkt\n", > idx); >@@ -370,7 +370,7 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi, > > /* Obtain buffer address from rqe_opaque */ > idx = cqe->rqe_opaque.lo; >- if ((idx < 0) || (idx > (QEDI_BDQ_NUM - 1))) { >+ if (idx > (QEDI_BDQ_NUM - 1)) { > QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN, > "wrong idx %d returned by FW, dropping the unsolicited pkt\n", > idx); >-- >2.7.4 Acked-by: Manish Rangankar