phy: rockchip-typec: Fix unsigned comparison with less than zero
Subsystems (2)
PATCH v2 1/1 phy: rockchip-typec: Fix unsigned comparison with less than zero
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 <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
---
Changes in v2:
-Add ufp modification.
drivers/phy/rockchip/phy-rockchip-typec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/phy/rockchip/phy-rockchip-typec.c +1 -2
@@ -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 ;
Signature · 1 line
2.20.1.7.g153144c
Quoted 4 lines · Jiapeng Chong
The dp and ufp are defined as bool type, the return value type of function
extcon_get_stateshould be int, so the type of dp and ufp are modified to int.
Applied, thanks
Signature · 1 line
~Vinod