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: 13131065 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 4C574C636CC for ; Tue, 7 Feb 2023 05:27:15 +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=t2l9RrEdvaVK1mSMb++6WyeCGmDLntdHACXtoCFJ89I=; b=EumSg6qECABhVI bfkJPdt3ZewHE2Um91jIFYrckm9WrnAhl0Fd5Kk7LI+Wo3FZq8t9xvLqNazYE9/SDTVN2DGhn/phf gNjW/pdD1B+aQWOXATGY1EqYNivTkUN1iQGd6ejhNkImzGp6dKBPZjan3qfY96dqlMuwbti3/+4vI ODdd9iL/j+Gbndcss1bkFmYxjPkqT90FXYFpqKS2cMwqsbj5kg/kLsixeXOq5UPKOGSdmTdauExpr 9oOSTId9YtX/BKYiX2pwtZpVJlOoqXhRHz4UwTO4d3jPqZ4MwxMM2HYGvZ2RfpG1FEr7giXW6oguH bbHBFl2WBKJtbmRFs1mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPGUo-00AroL-4G; Tue, 07 Feb 2023 05:26:22 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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;