Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp647785ybj; Thu, 7 May 2020 04:29:26 -0700 (PDT) X-Google-Smtp-Source: APiQypLuLpJCKNZufOFbT5cM2l/UIerJ9frwD/wttG0/BVB65U+GXdJkJ+QhprFp9MtT7hsTH9yH X-Received: by 2002:a17:906:6944:: with SMTP id c4mr11766412ejs.96.1588850966483; Thu, 07 May 2020 04:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588850966; cv=none; d=google.com; s=arc-20160816; b=lrWdKsEneh4cHVEAEuDkRCwyPI0j4lt3iOXYQxiZ/GjobfzEhgKMKUGSTuccKsvTIc jMDMIGTTZtjyJCldIgHRW+N4zU59NaGNIuJCunD5Frs9nCih0JquEO7bdqjoohmIb72y F+jX2esW+HO5hTU/IDefImD97sy1L/ipNt0CXXKFfwaSeWCcY1lYdmldfk/nGB6oxiiQ SB+XmtD8QImDV+yCVmueBTNTLDCk+SYinmrDCsAeKMKhjXDunosVrH0V/EyjRwaij6d6 nqtvxHHyYY/FDCVzEU+lRh2eMzuRxidUsD6Nuh14jFZ3+i2NwKgJ2GwSjow2ggpXc9or wa4g== 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 :message-id:date:subject:cc:to:from; bh=zDsXMRZL7Aoc7p/z3bJ2kXSE7zlu00WKGTwX4Y2Ghio=; b=ov4HdCj282ACDeHkk20BiN4HgqjawVXupExsf9PpH37f4KiUQ7anenxc2pYzoULBxO 5AXFDqCNPLfimJicQe9HB2yhyZdmChUEQedgpXYpuZFDygxLaHdNK3d7o8orRMfHoXDz ZarZ1QJ+O9ZABTz0lHHwepKHlM+pJNc3LeNAqEAEmv1D2bpt8LXTcCN0kJclLfQznyAV u5wGe7HqTdfa3Fbn11LF6w9orKDG5cmJfVv5o7H1EeIM16satJc7mW7nsvS9/phHBzXf xfSjFsL7bvvbOtVZ13uUUJhBUKzZsG8cQOQsccq51uEV7WXy6M7wRyFDQkKggsT1nfHC VEhg== 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 cq19si2763954edb.333.2020.05.07.04.29.03; Thu, 07 May 2020 04:29:26 -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 S1726807AbgEGLZH (ORCPT + 99 others); Thu, 7 May 2020 07:25:07 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3889 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbgEGLZG (ORCPT ); Thu, 7 May 2020 07:25:06 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B8738379BE6317962F8C; Thu, 7 May 2020 19:25:03 +0800 (CST) Received: from huawei.com (10.67.174.156) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 19:24:57 +0800 From: ChenTao To: , CC: , , , , , , , , , , , , Subject: [PATCH -next] drm/amd/dc: Remove a useless comparison Date: Thu, 7 May 2020 19:24:12 +0800 Message-ID: <20200507112412.10829-1-chentao107@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.156] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following warning: 'en' is uint32_t and can never be negative. drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_hpd.c:132:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if ((en < GPIO_DDC_LINE_MIN) || (en > GPIO_DDC_LINE_MAX)) { drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_generic.c:109:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if ((en < GPIO_DDC_LINE_MIN) || (en > GPIO_DDC_LINE_MAX)) { Reported-by: Hulk Robot Signed-off-by: ChenTao --- drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c | 2 +- drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c index f9e847e6555d..6cd50232c432 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_generic.c @@ -106,7 +106,7 @@ void dal_hw_generic_init( enum gpio_id id, uint32_t en) { - if ((en < GPIO_DDC_LINE_MIN) || (en > GPIO_DDC_LINE_MAX)) { + if (en > GPIO_DDC_LINE_MAX) { ASSERT_CRITICAL(false); *hw_generic = NULL; } diff --git a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c index 692f29de7797..f91f426699c0 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c @@ -129,7 +129,7 @@ void dal_hw_hpd_init( enum gpio_id id, uint32_t en) { - if ((en < GPIO_DDC_LINE_MIN) || (en > GPIO_DDC_LINE_MAX)) { + if (en > GPIO_DDC_LINE_MAX) { ASSERT_CRITICAL(false); *hw_hpd = NULL; } -- 2.22.0