diff options
| author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2023-02-13 11:57:09 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 16:32:01 +0100 |
| commit | d217a3746e12460c74847bc6489e628b69f3b4e4 (patch) | |
| tree | 1cb87c689784f1efc5f9c5626c02cc5296229f14 | |
| parent | be678ad82ef6ba4ea8a4e3c9ab27234d98267c1d (diff) | |
| download | linux-d217a3746e12460c74847bc6489e628b69f3b4e4.tar.gz linux-d217a3746e12460c74847bc6489e628b69f3b4e4.tar.bz2 linux-d217a3746e12460c74847bc6489e628b69f3b4e4.zip | |
phy: rockchip-typec: Fix unsigned comparison with less than zero
[ Upstream commit f765c59c5a72546a2d74a92ae5d0eb0329d8e247 ]
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>
| -rw-r--r-- | drivers/phy/rockchip/phy-rockchip-typec.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index 76a4b58ec771..ca4b80d0d8b7 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -817,9 +817,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; |
