From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Michael Büsch" <m@bues.ch>
Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: (bug report) b43: impossible conditions in debugfs
Date: Thu, 26 Nov 2015 16:00:34 +0300 [thread overview]
Message-ID: <20151126130033.GG7289@mwanda> (raw)
In-Reply-To: <20151126133241.5bc5a793@wiggum>
On Thu, Nov 26, 2015 at 01:32:41PM +0100, Michael B?sch wrote:
> > See also:
> > drivers/net/wireless/broadcom/b43/debugfs.c:346 mmio32write__write_file() warn: impossible condition '(mask > 4294967295) => (0-u32max > u32max)'
> > drivers/net/wireless/broadcom/b43/debugfs.c:346 mmio32write__write_file() warn: impossible condition '(set > 4294967295) => (0-u32max > u32max)'
>
>
>
> Sure. These are intentional.
> The compiler will optimize this out.
Hm... We try to ignore when people do intentional comparisons with zero
like this:
if (unsigned_var < 0 || unsigned_var >= 10)
return -EINVAL;
Because they are obviously harmless and they don't hurt readability.
Also Linus doesn't like removing these.
But what's the point of this? I have seen these before when I was
checking ide_set_disk_chs() for underflows. I also reported another one
recently that was exactly the same as this and the guy changed it from
if (x > UINT_MAX) to if (!(x < UINT_MAX))... I don't get it.
regards,
dan carpenter
next prev parent reply other threads:[~2015-11-26 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 11:59 (bug report) b43: impossible conditions in debugfs Dan Carpenter
2015-11-26 12:32 ` Michael Büsch
2015-11-26 13:00 ` Dan Carpenter [this message]
2015-11-26 13:34 ` Michael Büsch
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=20151126130033.GG7289@mwanda \
--to=dan.carpenter@oracle.com \
--cc=b43-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=m@bues.ch \
/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