From: Matthias Kaehlcke <mka@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
Grant Grundler <grundler@chromium.org>,
Greg Hackmann <ghackmann@google.com>,
Michael Davidson <md@google.com>
Subject: Re: [PATCH] kernel/irq: Limit validation of cpumask_var_t to CONFIG_CPUMASK_OFFSTACK=y
Date: Wed, 12 Apr 2017 09:43:37 -0700 [thread overview]
Message-ID: <20170412164337.GF28657@google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1704120916550.1874@nanos>
Hi Thomas,
El Wed, Apr 12, 2017 at 09:23:58AM +0200 Thomas Gleixner ha dit:
> On Tue, 11 Apr 2017, Matthias Kaehlcke wrote:
> > With CONFIG_CPUMASK_OFFSTACK=y cpumask_var_t is a struct cpumask
> > pointer, otherwise a struct cpumask array with a single element.
> >
> > irq_thread_check_affinity() validates the cpumask_var_t field in the
> > interrupt descriptor by checking if it is not NULL. This works for
> > both CONFIG_CPUMASK_OFFSTACK=y/n, however clang raises the following
> > warning with CONFIG_CPUMASK_OFFSTACK=n:
> >
> > kernel/irq/manage.c:839:28: error: address of array
> > 'desc->irq_common_data.affinity' will always evaluate to 'true'
> > [-Werror,-Wpointer-bool-conversion]
> >
> > To get rid of the warning only validate the cpumask_var_t field when
> > CONFIG_CPUMASK_OFFSTACK=y.
>
> This ifdeffery is horrible. Can you please create a helper inline
> cpumask_available() or something like that which hides this in a header
> file. The irq code is probably not the only place which does this.
Thanks for your comments, I'll rework the patch to use a helper
instead.
Cheers
Matthias
prev parent reply other threads:[~2017-04-12 16:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 23:52 [PATCH] kernel/irq: Limit validation of cpumask_var_t to CONFIG_CPUMASK_OFFSTACK=y Matthias Kaehlcke
2017-04-12 7:23 ` Thomas Gleixner
2017-04-12 16:43 ` Matthias Kaehlcke [this message]
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=20170412164337.GF28657@google.com \
--to=mka@chromium.org \
--cc=ghackmann@google.com \
--cc=grundler@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=md@google.com \
--cc=tglx@linutronix.de \
/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).