Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4392610ybi; Mon, 3 Jun 2019 10:06:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC4ALMyInkG41yTbKYIUjhPlOhj/FDY+SnSJdWit1ODo7IM+6alnRPtuFAfYFG7jPWEwLy X-Received: by 2002:a63:134a:: with SMTP id 10mr21290341pgt.242.1559581563066; Mon, 03 Jun 2019 10:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559581563; cv=none; d=google.com; s=arc-20160816; b=kFjkBWcTesadh78wYC9pO4TKeIFHhok36+bQLRfVPqrsKEU7QNDg+2fA5UIuDkQgPX dPSbuVzN10l159MLohAhViYj/Dlc79AfiOSZTSE06S9ZG2TW9RNFrIL+S3tbL6wRKDy5 VqvZuZRNOxy3UvNnuRMkfQPoSiWf1X9SIiFXBVtT+zxMr+jxz4tQI+CeDQK7nuud7KjK 7Ry5azA0Lv2OFq6mWUUXrQA3vNqdpZ09B2v+NvZaBGYNZNhaj5E7UMlQPBih5RIxhC9r RposSR43rKrrfewLx1IE7TRvvnIvmER12GIGVuEJaso6oAKZliQ+qQAdYSxxuHzb0E/p ThbA== 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=M+UPm9TVSp1l1+ty1fOtOsIucRV3M3LtC2LCgHy9RUU=; b=b1WgmGU3+3mVJ42h5YhmymPA0dQQWjazN1g6iIvckw0KcpYbTHmOI2HOaU015Fth7x RVjw+GJ32W5HlfbDuwndtPsjbCCqYXqHW4otxMJMG1T7TYbtK+TNLT7jWppzgbjHUGbc p/jbqAa/qH78QvZlBGug+VsOTWa9vzQFlhRcwZvWwD9KTTD4n3MQQ6E3N8BQp/btXZWx LJGFqkGOpdzuorbCqZi2mUELMp84L9mhWRZPWIYJksY5Zihy0mI0Jbsk7EWt3xDOSS86 dT+x9JXhULivxMH5Xc/VPQQ/U1t+ORoqcjIF9V8Sly/s/wsjC6N3alAUMglQ1tRTz0Gt Mz9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si18731758plo.137.2019.06.03.10.05.46; Mon, 03 Jun 2019 10:06:03 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729031AbfFCOVK (ORCPT + 99 others); Mon, 3 Jun 2019 10:21:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54005 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727429AbfFCOVJ (ORCPT ); Mon, 3 Jun 2019 10:21:09 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hXnpe-0002aE-GG; Mon, 03 Jun 2019 14:21:02 +0000 From: Colin King To: Jyri Sarha , Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] drm/bridge: sii902x: fix comparision of u32 with less than zero Date: Mon, 3 Jun 2019 15:21:02 +0100 Message-Id: <20190603142102.27191-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The less than check for the variable num_lanes is always going to be false because the variable is a u32. Fix this by making num_lanes an int and also make loop index i an int too. Addresses-Coverity: ("Unsigned compared against 0") Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") Signed-off-by: Colin Ian King --- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index d6f98d388ac2..21a947603c88 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x, .max_i2s_channels = 0, }; u8 lanes[4]; - u32 num_lanes, i; + int num_lanes, i; if (!of_property_read_bool(dev->of_node, "#sound-dai-cells")) { dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n", -- 2.20.1