From: Julia Lawall <julia.lawall@lip6.fr>
To: Andrew Lunn <andrew@lunn.ch>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: drivers/net/phy/marvell.c:1037:5-8: WARNING: Unsigned expression compared with zero: val < 0
Date: Wed, 17 Feb 2016 08:36:49 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.10.1602170835480.2685@hadrien> (raw)
In-Reply-To: <201602160727.5fWQ3FO3%fengguang.wu@intel.com>
Looks like a problem, please check.
julia
> >> drivers/net/phy/marvell.c:1037:5-8: WARNING: Unsigned expression compared with zero: val < 0
>
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git remote update linus
> git checkout d2fa47d9dd5c5f82d78c4503cf33989f67e8aa64
> vim +1037 drivers/net/phy/marvell.c
>
> d2fa47d9 Andrew Lunn 2015-12-30 1021 #define UINT64_MAX (u64)(~((u64)0))
> d2fa47d9 Andrew Lunn 2015-12-30 1022 #endif
> d2fa47d9 Andrew Lunn 2015-12-30 1023 static u64 marvell_get_stat(struct phy_device *phydev, int i)
> d2fa47d9 Andrew Lunn 2015-12-30 1024 {
> d2fa47d9 Andrew Lunn 2015-12-30 1025 struct marvell_hw_stat stat = marvell_hw_stats[i];
> d2fa47d9 Andrew Lunn 2015-12-30 1026 struct marvell_priv *priv = phydev->priv;
> d2fa47d9 Andrew Lunn 2015-12-30 1027 int err, oldpage;
> d2fa47d9 Andrew Lunn 2015-12-30 1028 u64 val;
> d2fa47d9 Andrew Lunn 2015-12-30 1029
> d2fa47d9 Andrew Lunn 2015-12-30 1030 oldpage = phy_read(phydev, MII_MARVELL_PHY_PAGE);
> d2fa47d9 Andrew Lunn 2015-12-30 1031 err = phy_write(phydev, MII_MARVELL_PHY_PAGE,
> d2fa47d9 Andrew Lunn 2015-12-30 1032 stat.page);
> d2fa47d9 Andrew Lunn 2015-12-30 1033 if (err < 0)
> d2fa47d9 Andrew Lunn 2015-12-30 1034 return UINT64_MAX;
> d2fa47d9 Andrew Lunn 2015-12-30 1035
> d2fa47d9 Andrew Lunn 2015-12-30 1036 val = phy_read(phydev, stat.reg);
> d2fa47d9 Andrew Lunn 2015-12-30 @1037 if (val < 0) {
> d2fa47d9 Andrew Lunn 2015-12-30 1038 val = UINT64_MAX;
> d2fa47d9 Andrew Lunn 2015-12-30 1039 } else {
> d2fa47d9 Andrew Lunn 2015-12-30 1040 val = val & ((1 << stat.bits) - 1);
> d2fa47d9 Andrew Lunn 2015-12-30 1041 priv->stats[i] += val;
> d2fa47d9 Andrew Lunn 2015-12-30 1042 val = priv->stats[i];
> d2fa47d9 Andrew Lunn 2015-12-30 1043 }
> d2fa47d9 Andrew Lunn 2015-12-30 1044
> d2fa47d9 Andrew Lunn 2015-12-30 1045 phy_write(phydev, MII_MARVELL_PHY_PAGE, oldpage);
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
next parent reply other threads:[~2016-02-17 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201602160727.5fWQ3FO3%fengguang.wu@intel.com>
2016-02-17 13:36 ` Julia Lawall [this message]
2016-02-17 13:57 ` Andrew Lunn
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=alpine.DEB.2.10.1602170835480.2685@hadrien \
--to=julia.lawall@lip6.fr \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®