From: Johannes Berg <johannes@sipsolutions.net>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v2] wireless: mark expected switch fall-throughs
Date: Tue, 23 Oct 2018 22:33:17 +0200 [thread overview]
Message-ID: <94958073867a5bbf8161d7ea8851aaea026762b1.camel@sipsolutions.net> (raw)
In-Reply-To: <c2fad584-1705-a5f2-d63c-824e9b96cf50@embeddedor.com>
On Tue, 2018-10-23 at 12:58 +0200, Gustavo A. R. Silva wrote:
> On 10/23/18 10:59 AM, Gustavo A. R. Silva wrote:
> >
> > On 10/23/18 9:01 AM, Johannes Berg wrote:
> > > On Tue, 2018-10-23 at 02:13 +0200, Gustavo A. R. Silva wrote:
> > > > In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> > > > where we are expecting to fall through.
> > > >
> > > > Warning level 3 was used: -Wimplicit-fallthrough=3
> > > >
> > > > This code was not tested and GCC 7.2.0 was used to compile it.
> > >
> > > Look, I'm not going to make this any clearer: I'm not applying patches
> > > like that where you've invested no effort whatsoever on verifying that
> > > they're correct.
> > >
> >
> > How do you suggest me to verify that every part is correct in this type
> > of patches?
> >
>
> BTW... I'm under the impression you think that I don't even look at
> the code. Is that correct?
That's what your commit log looks like, yes. This is your full commit
log:
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Warning level 3 was used: -Wimplicit-fallthrough=3
This code was not tested and GCC 7.2.0 was used to compile it.
For all I know, you could've run spatch to add the comments wherever
there was no break, and then compiled it once.
> I've been working on this for quite a while, and in every case I try to
> understand the code in terms of the context in which every warning is
> reported.
That's great.
> Here is a bug I found yesterday at drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>
> 5690 case WLAN_CIPHER_SUITE_CCMP:
> 5691 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
> 5692 break;
> 5693 case WLAN_CIPHER_SUITE_TKIP:
> 5694 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
> 5695 default:
> 5696 return -EOPNOTSUPP;
> 5697 }
Indeed, that looks like a bug, although kinda benign since it just means
TKIP will always use software crypto and TKIP is slow anyway ;-)
> I do this analysis for every warning. Now, when I say I haven't tested the code
> is because I don't have any log as evidence for anything. Not that I haven't put
> any effort on trying to understand it and its context. When I started working on
> this task there were more than 2000 of these issues, now there are around 600 left.
>
> I have fixed many bugs on the way, so a good amount of work is being invested on
> this, and it's paying off. :)
:-)
> Now, let me ask you this question:
>
> It would be easier for you to review this patch if I turn it into a series?
>
> I can do that without a problem.
I'd be happy if you were to actually just mention that you've looked at
them, and found them to be expected fall throughs. I'll still review
them, but without that information I feel like I'm doing the first round
of reviews this code ever got.
johannes
next prev parent reply other threads:[~2018-10-23 20:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 0:13 [PATCH v2] wireless: mark expected switch fall-throughs Gustavo A. R. Silva
2018-10-23 7:01 ` Johannes Berg
2018-10-23 8:59 ` Gustavo A. R. Silva
2018-10-23 10:58 ` Gustavo A. R. Silva
2018-10-23 20:33 ` Johannes Berg [this message]
2018-10-24 9:40 ` Julian Calaby
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=94958073867a5bbf8161d7ea8851aaea026762b1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=gustavo@embeddedor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).