From: Jonathan Cameron <jic23@kernel.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] iio: mma8452: mark expected switch fall-through
Date: Sun, 3 Mar 2019 17:04:28 +0000 [thread overview]
Message-ID: <20190303170428.1d3f631b@archlinux> (raw)
In-Reply-To: <e612e707-4a54-7b59-e350-139766529316@embeddedor.com>
On Wed, 20 Feb 2019 12:07:28 -0600
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> On 2/20/19 11:21 AM, Gustavo A. R. Silva wrote:
> >
> >
> > On 2/20/19 6:17 AM, Jonathan Cameron wrote:
> >> On Mon, 11 Feb 2019 16:23:18 -0600
> >> "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> >>
> >>> In preparation to enabling -Wimplicit-fallthrough, mark switch
> >>> cases where we are expecting to fall through.
> >>>
> >>> This patch fixes the following warning:
> >>>
> >>> drivers/iio/accel/mma8452.c: In function ‘mma8452_probe’:
> >>> drivers/iio/accel/mma8452.c:1581:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >>> if (ret == data->chip_info->chip_id)
> >>> ^
> >>> drivers/iio/accel/mma8452.c:1584:2: note: here
> >>> default:
> >>> ^~~~~~~
> >>>
> >>> Warning level 3 was used: -Wimplicit-fallthrough=3
> >>>
> >>> Notice that, in this particular case, the code comment is modified
> >>> in accordance with what GCC is expecting to find.
> >>>
> >>> This patch is part of the ongoing efforts to enable
> >>> -Wimplicit-fallthrough.
> >>>
> >>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >> I know Peter probably won't like this, as it doesn't
> >> read a as well, with the else dropped, but I'm going to take
> >> it as we have had a lot of bugs caught by this code and this
> >> is generating a false positive.
> >>
> >> Applied to the togreg branch of iio.git and pushed out as testing
> >> for the autobuilders to play with it.
> >>
> >
> > Thanks, Jonathan.
> >
>
> BTW, Jonathan, I wonder if you can apply this one too:
>
> https://lore.kernel.org/patchwork/patch/996804/
>
> Thanks
Now resolved. The issue here was the code was 'interesting/crazy' so
we needed someone with hardware to rewrite it and test the result.
Simply fixing the fall through wasn't enough :(
Jonathan
> --
> Gustavo
next prev parent reply other threads:[~2019-03-03 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 22:23 [PATCH] iio: mma8452: mark expected switch fall-through Gustavo A. R. Silva
2019-02-20 12:17 ` Jonathan Cameron
2019-02-20 17:21 ` Gustavo A. R. Silva
2019-02-20 18:07 ` Gustavo A. R. Silva
2019-03-03 17:04 ` Jonathan Cameron [this message]
2019-03-03 17:35 ` Gustavo A. R. Silva
-- strict thread matches above, loose matches on Subject: below --
2018-07-03 19:44 [PATCH] iio: mma8452: Mark " Gustavo A. R. Silva
2018-07-07 17:04 ` Jonathan Cameron
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=20190303170428.1d3f631b@archlinux \
--to=jic23@kernel.org \
--cc=gustavo@embeddedor.com \
--cc=keescook@chromium.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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.