Jiri Slaby 151706
From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Jiri Slaby 151706
Date: Mon, 13 Feb 2023 11:57:09 +0800
Jiri Slaby 151706
Subject: [PATCH] phy: rockchip-typec: Fix unsigned comparison with less than
Jiri Slaby 151706
 zero
Jiri Slaby 151706
References: bsc#1012628
Jiri Slaby 151706
Patch-mainline: 6.2.5
Jiri Slaby 151706
Git-commit: f765c59c5a72546a2d74a92ae5d0eb0329d8e247
Jiri Slaby 151706
Jiri Slaby 151706
[ Upstream commit f765c59c5a72546a2d74a92ae5d0eb0329d8e247 ]
Jiri Slaby 151706
Jiri Slaby 151706
The dp and ufp are defined as bool type, the return value type of
Jiri Slaby 151706
function extcon_get_state should be int, so the type of dp and ufp
Jiri Slaby 151706
are modified to int.
Jiri Slaby 151706
Jiri Slaby 151706
./drivers/phy/rockchip/phy-rockchip-typec.c:827:12-14: WARNING: Unsigned expression compared with zero: dp > 0.
Jiri Slaby 151706
Jiri Slaby 151706
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Jiri Slaby 151706
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3962
Jiri Slaby 151706
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Jiri Slaby 151706
Link: https://lore.kernel.org/r/20230213035709.99027-1-jiapeng.chong@linux.alibaba.com
Jiri Slaby 151706
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Jiri Slaby 151706
Signed-off-by: Sasha Levin <sashal@kernel.org>
Jiri Slaby 151706
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Jiri Slaby 151706
---
Jiri Slaby 151706
 drivers/phy/rockchip/phy-rockchip-typec.c | 3 +--
Jiri Slaby 151706
 1 file changed, 1 insertion(+), 2 deletions(-)
Jiri Slaby 151706
Jiri Slaby 151706
diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
Jiri Slaby 151706
index 6aea512e..39db8acd 100644
Jiri Slaby 151706
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
Jiri Slaby 151706
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
Jiri Slaby 151706
@@ -808,9 +808,8 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy)
Jiri Slaby 151706
 	struct extcon_dev *edev = tcphy->extcon;
Jiri Slaby 151706
 	union extcon_property_value property;
Jiri Slaby 151706
 	unsigned int id;
Jiri Slaby 151706
-	bool ufp, dp;
Jiri Slaby 151706
 	u8 mode;
Jiri Slaby 151706
-	int ret;
Jiri Slaby 151706
+	int ret, ufp, dp;
Jiri Slaby 151706
 
Jiri Slaby 151706
 	if (!edev)
Jiri Slaby 151706
 		return MODE_DFP_USB;
Jiri Slaby 151706
-- 
Jiri Slaby 151706
2.35.3
Jiri Slaby 151706