mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Nikita Danilov <nikita@clusterfs.com>
Cc: Roland Dreier <rolandd@cisco.com>,
	dwalker@mvista.com, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RT: epca_lock to DEFINE_SPINLOCK
Date: Thu, 29 Sep 2005 02:49:31 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0509290243320.10496@localhost.localdomain> (raw)
In-Reply-To: <17211.139.119978.52725@gargle.gargle.HOWL>


On Thu, 29 Sep 2005, Nikita Danilov wrote:

>
> The only reasonable case where DEFINE_FOO(x) is really necessary is when
> initializer uses address of x, but even in that case something like
>
>         spinlock_t guard = SPINLOCK_UNLOCKED(guard);
>
> is much more readable than
>
>         DEFINE_SPIN_LOCK(guard);
>

Except that the former is also error prone. I just found a bug in my code
(I customize Ingo's RT kernel) where I had a cut and paste error:

spinlock_t a = SPINLOCK_UNLOCKED(a);
spinlock_t b = SPINLOCK_UNLOCKED(a);

This took me two days to find since the problems occurred elsewhere.

-- Steve


      reply	other threads:[~2005-09-29  6:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-27 18:32 Daniel Walker
2005-09-27 22:34 ` Thomas Gleixner
2005-09-28  9:33 ` Ingo Molnar
2005-09-28  9:39 ` Arjan van de Ven
2005-09-28 15:54   ` Daniel Walker
2005-09-28 16:06   ` Roland Dreier
2005-09-28 20:43     ` Nikita Danilov
2005-09-29  6:49       ` Steven Rostedt [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=Pine.LNX.4.58.0509290243320.10496@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nikita@clusterfs.com \
    --cc=rolandd@cisco.com \
    /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

all inboxes | Powered by JetHome®