linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Wagner <wagi@monom.org>, Michal Marek <mmarek@suse.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>,
	Daniel Wagner <daniel.wagner@bmw-carit.de>
Subject: Re: [PATCH] kbuild: Add option to turn incompatible pointer check into error
Date: Tue, 8 Mar 2016 10:19:41 +0100	[thread overview]
Message-ID: <20160308091941.GD12413@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1603081010000.6083@nanos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> On Tue, 8 Mar 2016, Daniel Wagner wrote:
> 
> > From: Daniel Wagner <daniel.wagner@bmw-carit.de>
> > 
> > With the introduction of the simple wait API we have two very
> > similar APIs in the kernel. For example wake_up() and swake_up()
> > is only one character away. Although the compiler will warn
> > happily the wrong usage it keeps on going an even links the kernel.
> > Thomas and Peter would rather like to see early missuses reported
> > as error early on.
> > 
> > In a first attempt we tried to wrap all swait and wait calls
> > into a macro which has an compile time type assertion. The result
> > was pretty ugly and wasn't able to catch all wrong usages.
> > woken_wake_function(), autoremove_wake_function() and wake_bit_function()
> > are assigned as function pointers. Wrapping them with a macro around is
> > not possible. Prefixing them with '_' was also not a real option
> > because there some users in the kernel which do use them as well.
> > All in all this attempt looked to intrusive and too ugly.
> > 
> > An alternative is to turn the pointer type check into an error which
> > catches wrong type uses. Obviously not only the swait/wait ones. That
> > isn't a bad thing either.
> > 
> > Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> 
> Acked-by: Thomas Gleixner <tglx@linutronix.de>

Note that there will be a few build failures triggered by this, for example this 
fix from linux-next is needed:

> commit db9b60400f9253c25ae639797df2d0ff7a35d9d8
> Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> Date:   Tue Feb 2 11:35:55 2016 +0530
>
>     drm/gma500: remove helper function

Other than that:

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

  reply	other threads:[~2016-03-08  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  8:29 [PATCH] kbuild: Add option to turn incompatible pointer check into error Daniel Wagner
2016-03-08  9:10 ` Thomas Gleixner
2016-03-08  9:19   ` Ingo Molnar [this message]
2016-03-15 21:34     ` Michal Marek
2016-03-15 21:39       ` Michal Marek

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=20160308091941.GD12413@gmail.com \
    --to=mingo@kernel.org \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mmarek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=wagi@monom.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).