Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp557785ybz; Wed, 29 Apr 2020 05:21:24 -0700 (PDT) X-Google-Smtp-Source: APiQypIzGt3m/E4TPA+W4dF6VBfSfgPebGPTl97bykUS4+1diRyQWUUWDnDeKfFwaHn1yhjV28nG X-Received: by 2002:a17:906:af67:: with SMTP id os7mr2258421ejb.182.1588162884413; Wed, 29 Apr 2020 05:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588162884; cv=none; d=google.com; s=arc-20160816; b=puuWxZm/ws/6n1J/ZFqzGxjvIklkQvj2td84DStTAAnWZOYPTm/LgiPwz9gomjR6B9 arRtSVonGgt9cNjxHQ2OXwotkrKdObZQ4VnhIj8ea1bfyuFKa3FF4Qo9ygC+r5prPESz p4R5XjBu1ZbLZ+RFM39TnapTVyk+aR74Zm5F9pAs8NMvY7UEr1RUHmLq7NV9IyX1kQ6p xcMlsny3OBdddJgiQxg5BF1/55cvLxtsoKTjDQi2E6uK2UN15Uvai95Yltmi1gU3HbQP Pg330Ubwk4K6CmAoUhBEyGU3HFKD85NcaiGarL/x1M+U00XoFWSVPBkmzlWcFXvWSYkg zPfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=omMTsdzJkf0gvSKqpNC+H8J/v2rvrjGY84XQAo5MDgo=; b=qheL0tHDKDq4b/tTpyOCyM/RGUvMUGVEuNEInSMpaN8sHv09+abOUjXGSyaDkmcN7i HWsDoB0N3VidBYhSMsG7vUO/KYYTcIKg+g+0HpDB5zSz9lDZZxNc1aPS+G7RzR2vS4JH T4tjsnV3xoeds1U1mcuI3w5BDDouXb9exRhWoGbKLNSZvklR19lX3Dwo+cZ/faDpb6Eo oVW3z46BtT2eFuWqzWVR72RYHfUVrx+Pv4BJVGPKSS85vvucSY9BM+x58jvRVJbxCTzB cUb6yU02vDbchTN8LfP3lpBcKkgD9HIp63wHo92ciYgrESpXwH4bc5wRE07IxPQ7Sitn YkHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si3083106ejk.339.2020.04.29.05.20.59; Wed, 29 Apr 2020 05:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbgD2MR0 (ORCPT + 99 others); Wed, 29 Apr 2020 08:17:26 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39160 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726524AbgD2MR0 (ORCPT ); Wed, 29 Apr 2020 08:17:26 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2E69B2FDDB8262AA5332; Wed, 29 Apr 2020 20:16:17 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 20:16:11 +0800 From: Xiongfeng Wang To: , , , , , Subject: [PATCH] scsi: dpt_i2o: Remove always false 'chan < 0' statement Date: Wed, 29 Apr 2020 20:10:18 +0800 Message-ID: <1588162218-61757-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The channel index is represented by an unsigned variable 'u32 chan'. We don't need to check whether it is less than zero. The following statement is always false and let's remove it. 'chan < 0' Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang --- drivers/scsi/dpt_i2o.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 02dff3a..2cf8895 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -1120,7 +1120,7 @@ static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u6 { struct adpt_device* d; - if(chan < 0 || chan >= MAX_CHANNEL) + if (chan >= MAX_CHANNEL) return NULL; d = pHba->channel[chan].device[id]; -- 1.7.12.4