From: Vinod Koul <vkoul@kernel.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: kishon@kernel.org, heiko@sntech.de, p.zabel@pengutronix.de,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] phy: rockchip-typec: Fix unsigned comparison with less than zero
Date: Fri, 10 Feb 2023 22:24:30 +0530 [thread overview]
Message-ID: <Y+Z2xs8gu8eV5rS1@matsya> (raw)
In-Reply-To: <20230207052606.29506-1-jiapeng.chong@linux.alibaba.com>
On 07-02-23, 13:26, Jiapeng Chong wrote:
> The dp is defined as bool type, the return value type of function
> extcon_get_state should be int, at the same time,if(dp>0) is used as the
> conditional statement, so the type of dp is modified to int.
>
> ./drivers/phy/rockchip/phy-rockchip-typec.c:827:12-14: WARNING: Unsigned expression compared with zero: dp > 0.
You should see same error for ufp as well, that also stores return of
extcon_get_state()
>
> 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>
> ---
> drivers/phy/rockchip/phy-rockchip-typec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index 6aea512e5d4e..85ed7d510cbf 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -808,9 +808,9 @@ 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;
> + bool ufp;
> u8 mode;
> - int ret;
> + int ret, dp;
>
> if (!edev)
> return MODE_DFP_USB;
> --
> 2.20.1.7.g153144c
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-02-10 16:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 5:26 [PATCH] phy: rockchip-typec: Fix unsigned comparison with less than zero Jiapeng Chong
2023-02-10 16:54 ` Vinod Koul [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+Z2xs8gu8eV5rS1@matsya \
--to=vkoul@kernel.org \
--cc=abaci@linux.alibaba.com \
--cc=heiko@sntech.de \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox