diff mbox series

[v2] phy: rockchip-typec: Fix unsigned comparison with less than zero

Message ID 20230213035709.99027-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series [v2] phy: rockchip-typec: Fix unsigned comparison with less than zero | expand

Commit Message

Jiapeng Chong Feb. 13, 2023, 3:57 a.m. UTC
The dp and ufp are defined as bool type, the return value type of
function extcon_get_state should be int, so the type of dp and ufp
are 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 <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3962
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
  -Add ufp modification.

 drivers/phy/rockchip/phy-rockchip-typec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Vinod Koul Feb. 14, 2023, 1:58 p.m. UTC | #1
On 13-02-23, 11:57, Jiapeng Chong wrote:
> The dp and ufp are defined as bool type, the return value type of
> function extcon_get_state should be int, so the type of dp and ufp
> are modified to int.
> 

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 6aea512e5d4e..39db8acde61a 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -808,9 +808,8 @@  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;
 	u8 mode;
-	int ret;
+	int ret, ufp, dp;
 
 	if (!edev)
 		return MODE_DFP_USB;