From patchwork Tue Feb 7 05:26:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 13131064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B19CC636CD for ; Tue, 7 Feb 2023 05:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1FEVWgjyjVicLMMNCVndy1v6KdV1Xm3QTNQLVbcdw8o=; b=b2p5dUWaABqZcO YiUqVW1gEupZCJ6DU51vi/TTlYlloY21clCHSeWHCVWx5cZJIzj/4Rbeh1D2UIHvqlUbp7azdNXpP IXYMvKlCXHdLA3+4zwLOjUoryM43Cvz+e+2AinOR99Gt/QA9+XHxdu1A5lVZBylTrwM/FDXMbYr6x RV8kdq4U3ukvrw+vINcRn10SuNKBlJ9Vd/4RHh2hyBDQ9hRx3GrYgToI/irY6q3QX6lXZdhsQ+1y2 yY2XHlXDLwZABDoSU/3UU8BbcWwB4egX6qDgcbqrAHSNo6dBs2JRNiUove90tUDN+naMJX1q1n7ja R2aLIJW69Jw4Qa+7BvtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPGUv-00Arpm-4U; Tue, 07 Feb 2023 05:26:29 +0000 Received: from out30-113.freemail.mail.aliyun.com ([115.124.30.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPGUk-00Arnf-LO; Tue, 07 Feb 2023 05:26:20 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0Vb5fT1I_1675747568; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0Vb5fT1I_1675747568) by smtp.aliyun-inc.com; Tue, 07 Feb 2023 13:26:14 +0800 From: Jiapeng Chong To: vkoul@kernel.org Cc: kishon@kernel.org, heiko@sntech.de, p.zabel@pengutronix.de, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] phy: rockchip-typec: Fix unsigned comparison with less than zero Date: Tue, 7 Feb 2023 13:26:06 +0800 Message-Id: <20230207052606.29506-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_212619_053421_2A458194 X-CRM114-Status: UNSURE ( 9.40 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The dp is defined as bool type, the return value type of function extcon_get_state should be int, at the same time,if(dp>0) is used as the conditional statement, so the type of dp is modified to int. ./drivers/phy/rockchip/phy-rockchip-typec.c:827:12-14: WARNING: Unsigned expression compared with zero: dp > 0. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3962 Signed-off-by: Jiapeng Chong --- drivers/phy/rockchip/phy-rockchip-typec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index 6aea512e5d4e..85ed7d510cbf 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -808,9 +808,9 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy) struct extcon_dev *edev = tcphy->extcon; union extcon_property_value property; unsigned int id; - bool ufp, dp; + bool ufp; u8 mode; - int ret; + int ret, dp; if (!edev) return MODE_DFP_USB;