]> git.baikalelectronics.ru Git - kernel.git/commitdiff
phy: rockchip-typec: Fix unsigned comparison with less than zero
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Mon, 13 Feb 2023 03:57:09 +0000 (11:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:40 +0000 (13:55 +0100)
[ Upstream commit 7110c2fa9ed6f864986b26321f96be39dbfb1757 ]

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>
Link: https://lore.kernel.org/r/20230213035709.99027-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/rockchip/phy-rockchip-typec.c

index 6aea512e5d4ee781e6de31085915629e833d6642..39db8acde61afb758620131030613723ab2cbaad 100644 (file)
@@ -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;