netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, Vidya Sagar Ravipati <vidya@cumulusnetworks.com>
Subject: Re: [PATCH ethtool] ethtool: qsfp: fix special value comparison
Date: Thu, 14 Mar 2019 14:43:34 -0400	[thread overview]
Message-ID: <20190314184333.GF31709@tuxdriver.com> (raw)
In-Reply-To: <20190314183316.97259E0090@unicorn.suse.cz>

On Thu, Mar 14, 2019 at 07:33:16PM +0100, Michal Kubecek wrote:
> One of the warnings gcc issues when building ethtool with -Wall seems to
> point to an actual problem:
> 
> qsfp.c: In function 'sff8636_show_dom':
> qsfp.c:709:57: warning: comparison is always false due to limited range of data type [-Wtype-limits]
>   if ((sd.sfp_temp[MCURR] == 0x0) || (sd.sfp_temp[MCURR] == 0xFFFF))
>                                                           ^~
> 
> Rather than writing the special value as -1 which would be a bit confusing,
> cast 0xFFFF to __s16.
> 
> Fixes: a5e73bb05ee4 ("ethtool:QSFP Plus/QSFP28 Diagnostics Information Support")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

LGTM -- queued for next release.

Thanks,

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

      reply	other threads:[~2019-03-14 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 18:33 [PATCH ethtool] ethtool: qsfp: fix special value comparison Michal Kubecek
2019-03-14 18:43 ` John W. Linville [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=20190314184333.GF31709@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=vidya@cumulusnetworks.com \
    /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).