From: "Michael S. Tsirkin" <mst@redhat.com>
To: Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com>
Cc: davem@davemloft.net, nikolay@cumulusnetworks.com,
netdev@vger.kernel.org, volodymyr.bendiuga@westermo.se,
Jonas Johansson <jonas.johansson@westermo.se>
Subject: Re: [PATCH net-next] uapi: fix signess in ethtool_validate_speed()
Date: Fri, 20 Jan 2017 18:36:44 +0200 [thread overview]
Message-ID: <20170120183606-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1484918453-5849-1-git-send-email-volodymyr.bendiuga@gmail.com>
On Fri, Jan 20, 2017 at 02:20:53PM +0100, Volodymyr Bendiuga wrote:
> From: Jonas Johansson <jonas.johansson@westermo.se>
>
> There is a comparison of speed variable which
> is unsigned, and SPEED_UNKNOWN which is signed.
So?
>
> Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
> Signed-off-by: Volodymyr Bendiuga <volodymyr.bendiuga@gmail.com>
> ---
> include/uapi/linux/ethtool.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index f0db778..1ca4a77 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -1500,7 +1500,7 @@ enum ethtool_link_mode_bit_indices {
>
> #define SPEED_UNKNOWN -1
>
> -static inline int ethtool_validate_speed(__u32 speed)
> +static inline int ethtool_validate_speed(__s32 speed)
> {
> return speed <= INT_MAX || speed == SPEED_UNKNOWN;
> }
Then comparison to INT_MAX does not make sense.
> --
> 2.7.4
next prev parent reply other threads:[~2017-01-20 16:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 13:20 [PATCH net-next] uapi: fix signess in ethtool_validate_speed() Volodymyr Bendiuga
2017-01-20 16:36 ` Michael S. Tsirkin [this message]
[not found] ` <CABHmqqAaram+jGGfAM4qGRSuucxZag-pRoc2aBqgQsnWVzNRUQ@mail.gmail.com>
2017-01-24 14:51 ` Michael S. Tsirkin
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=20170120183606-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=jonas.johansson@westermo.se \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=volodymyr.bendiuga@gmail.com \
--cc=volodymyr.bendiuga@westermo.se \
/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;
as well as URLs for NNTP newsgroup(s).