From patchwork Sat Jun 24 16:24:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 9807833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1048860382 for ; Sat, 24 Jun 2017 16:27:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0113728497 for ; Sat, 24 Jun 2017 16:27:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9D422876D; Sat, 24 Jun 2017 16:27:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41A8028773 for ; Sat, 24 Jun 2017 16:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755049AbdFXQ1A (ORCPT ); Sat, 24 Jun 2017 12:27:00 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34679 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbdFXQZf (ORCPT ); Sat, 24 Jun 2017 12:25:35 -0400 Received: by mail-wr0-f195.google.com with SMTP id k67so20036471wrc.1; Sat, 24 Jun 2017 09:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NZvimuuVTlxZYuQlQ0t3dH6HetFsPmAlAMAuPyZxm/Y=; b=kDf9l1x9uWk3kR7t+jg+j7zZVQswgR4DAqRsEWtAoKgWJD+7dvm29CS+YLbqfGqZNI zV6PJ82dvVoJuS//M2nc9fuTcnvWyqYFtT8vZmvORK8vAiIcVQOEPSBI8be3gR3mZwEZ ApvugCL0ia4irQRROLzhMpXnz6lcvVVCLYtl10NOqbZ3FLTptOYF+ePG73mAtD+2jRCA LpVz3R9NYr9pPJMV6tA6e8s+zAKee4Eyzs2XzetbbEAKp323DGG51BMvFX5rRo2fUV77 We1GmcWHA3s+NvM3r/GC7BMO6xc9tYHHX2U361sgLLA0ARKkJWPKIRpNhe/6ac4KRVmB IORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NZvimuuVTlxZYuQlQ0t3dH6HetFsPmAlAMAuPyZxm/Y=; b=Wq0IMESGxpXCVrIpj12yVN1FwcJTnFJBYyo1rwovDC0elKJ4YAsUh8nyCM5uvyMiWk 7r6ZAcommYwloHJSMc8AmPxx4Ewke8aYWe+TeyjWW0QLZ4r7dffULmtD9MO1Q+nw7Nln 8D1uGnLV1L9ZKFEtFUqpRcwTnRc20S2JJWkpAluwL1pHZZWawdhg7xZTgiiEKzVpaPmu UeNqfaaIsW0MEciVJJRG49L2Sf3ZV04j9f2K7g0C96IS49z0hun5p7I4WQHT1yAEM5xh c9h/JlTcfX8K33vBToeqT2z8zr5UT6D24jUGz/5becw8YYPAedK4QKG536zpwzBCrCKV Ar7A== X-Gm-Message-State: AKS2vOyHKQZc/JWgrRkOEdjhv/Q/lWVr1Vym4CH0ug6ApjpCQ9h8NYzd Nh4h72dKjZvmwocz4I1Ycg== X-Received: by 10.28.214.148 with SMTP id n142mr3881871wmg.35.1498321533566; Sat, 24 Jun 2017 09:25:33 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:347e:2778:7713:8535]) by smtp.gmail.com with ESMTPSA id 201sm10946213wmy.15.2017.06.24.09.25.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Jun 2017 09:25:32 -0700 (PDT) From: Christos Gkekas To: QLogic-Storage-Upstream@cavium.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] scsi: qedi: Remove comparison of u16 idx with zero. Date: Sat, 24 Jun 2017 17:24:45 +0100 Message-Id: <1498321485-21677-1-git-send-email-chris.gekas@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable idx is defined as u16 thus statement (idx < 0) is always false and should be removed. Signed-off-by: Christos Gkekas Acked-by: Manish Rangankar --- 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);