From: Dan Carpenter <dan.carpenter@oracle.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [patch -next] ath9k: fix ath9k_hw_nvram_check_version()
Date: Sun, 20 Dec 2015 23:33:36 +0300 [thread overview]
Message-ID: <20151220203335.GX5284@mwanda> (raw)
In-Reply-To: <1450638355.3430.34.camel@perches.com>
On Sun, Dec 20, 2015 at 11:05:55AM -0800, Joe Perches wrote:
> On Sun, 2015-12-20 at 20:00 +0100, Julia Lawall wrote:
> > On Sun, 20 Dec 2015, Joe Perches wrote:
> >
> > > On Sat, 2015-12-19 at 13:59 +0300, Dan Carpenter wrote:
> > > > There is a type bug so it always returns success.
> > >?
> > > How many false positives do you have to sift
> > > through to find this sort of error?
> >
> > The return type is thoughtfully bool, so it should be easy in this case.??
> > The function has a return -EINVAL and a return true, so even without the?
> > return type it would be locally apparent that there is an inconsistency.
>
> True, -EINVAL is a non-bool constant, but
> bool returns can be a variable int.
>
> Dan, was the check any constant non-bool?
This warning is for returning negative with unsigned types smaller than
int. It's doing cross function flow analysis so it could warning about
other things besides constants, but it's 90% constants. It warns
about ds2482_w1_triplet() for example.
There aren't many false positives.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] ath9k: fix ath9k_hw_nvram_check_version()
Date: Sun, 20 Dec 2015 20:33:36 +0000 [thread overview]
Message-ID: <20151220203335.GX5284@mwanda> (raw)
In-Reply-To: <1450638355.3430.34.camel@perches.com>
On Sun, Dec 20, 2015 at 11:05:55AM -0800, Joe Perches wrote:
> On Sun, 2015-12-20 at 20:00 +0100, Julia Lawall wrote:
> > On Sun, 20 Dec 2015, Joe Perches wrote:
> >
> > > On Sat, 2015-12-19 at 13:59 +0300, Dan Carpenter wrote:
> > > > There is a type bug so it always returns success.
> > >
> > > How many false positives do you have to sift
> > > through to find this sort of error?
> >
> > The return type is thoughtfully bool, so it should be easy in this case.
> > The function has a return -EINVAL and a return true, so even without the
> > return type it would be locally apparent that there is an inconsistency.
>
> True, -EINVAL is a non-bool constant, but
> bool returns can be a variable int.
>
> Dan, was the check any constant non-bool?
This warning is for returning negative with unsigned types smaller than
int. It's doing cross function flow analysis so it could warning about
other things besides constants, but it's 90% constants. It warns
about ds2482_w1_triplet() for example.
There aren't many false positives.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] ath9k: fix ath9k_hw_nvram_check_version()
Date: Sun, 20 Dec 2015 23:33:36 +0300 [thread overview]
Message-ID: <20151220203335.GX5284@mwanda> (raw)
In-Reply-To: <1450638355.3430.34.camel@perches.com>
On Sun, Dec 20, 2015 at 11:05:55AM -0800, Joe Perches wrote:
> On Sun, 2015-12-20 at 20:00 +0100, Julia Lawall wrote:
> > On Sun, 20 Dec 2015, Joe Perches wrote:
> >
> > > On Sat, 2015-12-19 at 13:59 +0300, Dan Carpenter wrote:
> > > > There is a type bug so it always returns success.
> > >
> > > How many false positives do you have to sift
> > > through to find this sort of error?
> >
> > The return type is thoughtfully bool, so it should be easy in this case.
> > The function has a return -EINVAL and a return true, so even without the
> > return type it would be locally apparent that there is an inconsistency.
>
> True, -EINVAL is a non-bool constant, but
> bool returns can be a variable int.
>
> Dan, was the check any constant non-bool?
This warning is for returning negative with unsigned types smaller than
int. It's doing cross function flow analysis so it could warning about
other things besides constants, but it's 90% constants. It warns
about ds2482_w1_triplet() for example.
There aren't many false positives.
regards,
dan carpenter
next prev parent reply other threads:[~2015-12-20 20:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-19 10:59 [ath9k-devel] [patch -next] ath9k: fix ath9k_hw_nvram_check_version() Dan Carpenter
2015-12-19 10:59 ` Dan Carpenter
2015-12-19 10:59 ` Dan Carpenter
2015-12-19 11:12 ` [ath9k-devel] " Martin Blumenstingl
2015-12-19 11:12 ` Martin Blumenstingl
2015-12-19 11:12 ` Martin Blumenstingl
2015-12-20 18:47 ` [ath9k-devel] " Joe Perches
2015-12-20 18:47 ` Joe Perches
2015-12-20 18:47 ` Joe Perches
2015-12-20 19:00 ` [ath9k-devel] " Julia Lawall
2015-12-20 19:00 ` Julia Lawall
2015-12-20 19:00 ` Julia Lawall
2015-12-20 19:05 ` [ath9k-devel] " Joe Perches
2015-12-20 19:05 ` Joe Perches
2015-12-20 19:05 ` Joe Perches
2015-12-20 20:33 ` Dan Carpenter [this message]
2015-12-20 20:33 ` Dan Carpenter
2015-12-20 20:33 ` Dan Carpenter
2016-01-07 13:05 ` [ath9k-devel] " Kalle Valo
2016-01-07 13:05 ` Kalle Valo
2016-01-07 13:05 ` Kalle Valo
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=20151220203335.GX5284@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ath9k-devel@lists.ath9k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.