public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Daniel Wagner <wagi@monom.org>,
	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, 15 Mar 2016 22:34:59 +0100	[thread overview]
Message-ID: <56E88003.3050708@suse.com> (raw)
In-Reply-To: <20160308091941.GD12413@gmail.com>

Dne 8.3.2016 v 10:19 Ingo Molnar napsal(a):
> 
> * 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>

Applied to kbuild.git#kbuild.

> 
> 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

OK. I will send a pull request to Linus only after at least
x86_64/allyescofnig is fixed.

Michal

  reply	other threads:[~2016-03-15 21:35 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
2016-03-15 21:34     ` Michal Marek [this message]
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=56E88003.3050708@suse.com \
    --to=mmarek@suse.com \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.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