From: Bart Van Assche <bvanassche@acm.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Arun Easi <aeasi@marvell.com>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] handle more graciously labels with no statement
Date: Mon, 26 Oct 2020 16:22:12 -0700 [thread overview]
Message-ID: <3abeaeef-ddde-5c47-f79b-4c61a0820c08@acm.org> (raw)
In-Reply-To: <CAHk-=wh2ta_qhejh1C87sZcz09MfNTtxYU8EFy4zKQ0zQfVY=w@mail.gmail.com>
On 10/26/20 3:56 PM, Linus Torvalds wrote:
> On Mon, Oct 26, 2020 at 1:48 PM Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>>
>> On Mon, Oct 26, 2020 at 10:41:36AM -0700, Linus Torvalds wrote:
>>> But can you point to the actual 5.10-rc1 problem? I haven't seen the
>>> report, and afaik gcc will complain about this too ("label at end of
>>> compound statement") so I'm surprised sparse hits it..
>>
>> Well, I was surprised it wasn't caught and was ready to send a patch
>> but it can only happen when using sparse, see below, quite ironic:
>> drivers/scsi/qla2xxx/qla_tmpl.c:1052.
>> 1050 }
>> 1051
>> 1052 bailout:
>> 1053 #ifndef __CHECKER__
>> 1054 if (!hardware_locked)
>> 1055 spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
>> 1056 #endif
>> 1057 }
>
> Yeah, that "don't sparse this" pattern has been problematic before.
>
> I removed it.
>
> Bart, Arun - see commit 4525c8781ec0 ("scsi: qla2xxx: remove incorrect
> sparse #ifdef").
Hi Linus,
Thank you for having Cc-ed me. I agree that it's better to make the
kernel code compliant with the C standard than to make sparse accept
non-standard code.
The #ifndef __CHECKER__ / #endif that I added in 2015 in the above code
(commit 8d16366b5f23) was added because at that time I didn't see a
better solution.
BTW, personally I'm neither enthusiast about #ifndef __CHECKER__ /
#endif nor about if (expression) <locking statement>.
Bart.
next prev parent reply other threads:[~2020-10-26 23:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 4:53 [PATCH] handle more graciously labels with no statement Luc Van Oostenryck
2020-10-26 17:41 ` Linus Torvalds
2020-10-26 20:48 ` Luc Van Oostenryck
2020-10-26 22:56 ` Linus Torvalds
2020-10-26 23:22 ` Bart Van Assche [this message]
2020-10-26 23:39 ` Linus Torvalds
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=3abeaeef-ddde-5c47-f79b-4c61a0820c08@acm.org \
--to=bvanassche@acm.org \
--cc=aeasi@marvell.com \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=torvalds@linux-foundation.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).