Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion

From: Daniel Wagner
Date: Thu Nov 26 2015 - 07:22:51 EST


Hi Thomas,

On 11/24/2015 02:03 PM, Daniel Wagner wrote:
> The API provided by wait.h and swait.h is very similiar. Most of the
> time your are only one character away from either of it:
>
> wake_up() vs swake_up()
>
> This is on purpose so that we do not have two nearly identical bits of
> infrastructre code with dissimilar names.
>
> A compile time type check assertion ensures that obvious wrong usage
> is caught at early stage.

Obviously, this didn't really work as one can see with patch #4. That
one just compiled. So I wrapped almost all functions to get a better
check coverage. woken_wake_function(), autoremove_wake_function() and
wake_bit_function() can't be wrapped easily because DEFINE_WAIT and
friends. I just left them out.

The result looks pretty bad in my opinion. Probably it would be
better do add -Werror=incompatible-pointer-types to the CFLAGS.

Is that what you had in mind?

cheers,
daniel