Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278944

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

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion
Date 2015-11-27 21:20 +0100
Message-ID <qzxER-7w1-7@gated-at.bofh.it> (permalink)
References <qylw6-5A-7@gated-at.bofh.it> <qylw7-5A-31@gated-at.bofh.it> <qz3Qt-55g-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 26 Nov 2015, Daniel Wagner wrote:
> 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.

That's really bad.

If we can pull off the -Werror=incompatible-pointer-types trick, that
would solve it nicely.
 
Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip v4 0/5] Simple wait queue support Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
  [PATCH tip v4 5/5] rcu: use simple wait queues where possible in rcutree Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
  [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
    Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check assertion Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-26 13:30 +0100
      Re: [PATCH tip v4 2/5] [s]wait: Add compile time type check  assertion Thomas Gleixner <tglx@linutronix.de> - 2015-11-27 21:20 +0100
  [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while holding rnp->lock Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100
    Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while  holding rnp->lock Boqun Feng <boqun.feng@gmail.com> - 2015-11-25 02:10 +0100
      Re: [PATCH tip v4 4/5] rcu: Do not call rcu_nocb_gp_cleanup() while  holding rnp->lock Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-25 11:30 +0100
  [PATCH tip v4 3/5] KVM: use simple waitqueue for vcpu->wq Daniel Wagner <daniel.wagner@bmw-carit.de> - 2015-11-24 14:10 +0100

csiph-web