Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1949609ybv; Fri, 14 Feb 2020 08:44:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwxvVmmi8jAR4XgYxnF2inUYkSzUWN5z1PuQjD/h/WGShttnNfAPzjK1qzdVTn0t3+qVPFt X-Received: by 2002:a54:408f:: with SMTP id i15mr2421899oii.64.1581698650745; Fri, 14 Feb 2020 08:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581698650; cv=none; d=google.com; s=arc-20160816; b=QmKyLnJoqFEOnDWIBUE56uOUE5DOgKyeV8UlgEJbAeVR3j3y25SpZT5Q9ADSdNdZaI EQSA6MjNxKhb91lpcNpM0Nhq10/t1IeAXdIA4SIOzR98n8fx+cRnz9QcsB5LuSOsCgXw I+UgWgg64ljbldyVLQTXvuj3x0tNWpYxvzclm8/PgotpbQPrbIL1WusAQUckBPtMF1ol NrPKIRuBqsNrarMkc9APvgb7doJcPXGTStuIcjz2tAF30JwrxPNvifkcUXF6MZuj+vjH 7V6IggsDxTPemKQ08Y/vleyAXFjzkLJE92ejLVxp+7y0rhiQ5QZyV320Rh7zDmPO6Z8g MNGQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CoQqkObci4GNy4U4yMeMMLn6LfOuUcse3IeltikC8Ws=; b=UKkFF2c55veG4+Rjy83t9vitV7Yda+yK7xE7BYj+SsAg+ZlYwDK20XMYBkAhPkFPNI V3qMfxH+R7eK52LX99Euwq7i1q/xvBHEhCNIZbisC0PKn2lG0vjUIUDtt52v3JEJChqN AMNxWxBBVMM/8cLW2hnHY8ZvWz3c3FsbZMgZQMPVJrzHigSCbJsJmMbBviwo8In9g0U2 eqQ5KluPl6ojNRHuKo83ar709PcG+Diw/aTfKVyHI2Osp7UP2naBLLvpNrz8gpOXd4nT nd7B1SIjbfjRFMlRxx3C+RPVqc4DYTQd/0VrD4G7zo+8rqwqZzJHX8oBZIJJQE3cQ+Hv yZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pfv3GFDj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si3303087oti.34.2020.02.14.08.43.58; Fri, 14 Feb 2020 08:44:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pfv3GFDj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394024AbgBNQnT (ORCPT + 99 others); Fri, 14 Feb 2020 11:43:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:57160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405383AbgBNQWH (ORCPT ); Fri, 14 Feb 2020 11:22:07 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CF48246D8; Fri, 14 Feb 2020 16:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581697327; bh=FcvBkKpzEgcoIU2wYmSoYkgz1dx3PGPVxKSmKX7uaaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pfv3GFDjRAbHVAFQj6jBUhzX9MdPyDKcjUQjRjh34cgyC1EiwHyY+xAcq+QwB8kLW stJ4A/idyWW7Qqtq1IpIJ/PSMbfFHqm/PYbWg21VBqbXhnlyYLsfzkASQPFw6OBGJ4 Up0Cjn1pFxHlyE0WCD9GzVRWlshHeA2glbLZRQDo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: yu kuai , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.9 035/141] drm/amdgpu: remove always false comparison in 'amdgpu_atombios_i2c_process_i2c_ch' Date: Fri, 14 Feb 2020 11:19:35 -0500 Message-Id: <20200214162122.19794-35-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214162122.19794-1-sashal@kernel.org> References: <20200214162122.19794-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: yu kuai [ Upstream commit 220ac8d1444054ade07ce14498fcda266410f90e ] Fixes gcc '-Wtype-limits' warning: drivers/gpu/drm/amd/amdgpu/atombios_i2c.c: In function ‘amdgpu_atombios_i2c_process_i2c_ch’: drivers/gpu/drm/amd/amdgpu/atombios_i2c.c:79:11: warning: comparison is always false due to limited range of data type [-Wtype-limits] 'num' is 'u8', so it will never be greater than 'TOM_MAX_HW_I2C_READ', which is defined as 255. Therefore, the comparison can be removed. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Signed-off-by: yu kuai Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/atombios_i2c.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c index b374653bd6cf3..741bd1e52699b 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c @@ -69,11 +69,6 @@ static int amdgpu_atombios_i2c_process_i2c_ch(struct amdgpu_i2c_chan *chan, memcpy(&out, &buf[1], num); args.lpI2CDataOut = cpu_to_le16(out); } else { - if (num > ATOM_MAX_HW_I2C_READ) { - DRM_ERROR("hw i2c: tried to read too many bytes (%d vs 255)\n", num); - r = -EINVAL; - goto done; - } args.ucRegIndex = 0; args.lpI2CDataOut = 0; } -- 2.20.1