From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Cliff Whickman <cpw@sgi.com>, Robin Holt <robinmholt@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: [sgi-xp] Missing break or false positive?
Date: Tue, 26 Feb 2019 22:24:54 -0600 [thread overview]
Message-ID: <20190227042454.GA29535@embeddedor> (raw)
Hi all,
I'm taking a look into the following piece of code in drivers/misc/sgi-xp/xpc_uv.c:
561 case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV: {
562 struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg;
563
564 if (!part_setup)
565 break;
566
567 msg = container_of(msg_hdr, struct
568 xpc_activate_mq_msg_chctl_opencomplete_uv, hdr);
569 spin_lock_irqsave(&part->chctl_lock, irq_flags);
570 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_OPENCOMPLETE;
571 spin_unlock_irqrestore(&part->chctl_lock, irq_flags);
572
573 xpc_wakeup_channel_mgr(part);
574 }
and I'm trying to figure out if the following warning is due to a missing break
at the end of the case, or if this is just a false positive and a /* fall through */
annotation should be added:
drivers/misc/sgi-xp/xpc_uv.c: In function ‘xpc_handle_activate_mq_msg_uv’:
drivers/misc/sgi-xp/xpc_uv.c:573:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
xpc_wakeup_channel_mgr(part);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/sgi-xp/xpc_uv.c:575:2: note: here
case XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV:
^~~~
The piece of code above was introduced by the following commit in 2009:
efdd06ed181a88a11e612238c1ac04668e665395
The cases are pretty similar, and the fact that this code was introduced
in the middle of the switch statement and not at the end or the beginning,
leads me to believe that this is a false positive. On the other hand,
all the other cases end with a break or a return but this one. So, I
better ask your opinions about this.
Thanks
--
Gustavo
next reply other threads:[~2019-02-27 4:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 4:24 Gustavo A. R. Silva [this message]
2019-03-20 14:37 ` [sgi-xp] Missing break or false positive? Gustavo A. R. Silva
2019-03-20 15:23 ` Robin Holt
2019-03-20 15:36 ` Gustavo A. R. Silva
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=20190227042454.GA29535@embeddedor \
--to=gustavo@embeddedor.com \
--cc=arnd@arndb.de \
--cc=cpw@sgi.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robinmholt@gmail.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).