mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <nikita@clusterfs.com>
To: Roland Dreier <rolandd@cisco.com>
Cc: 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 00:43:55 +0400	[thread overview]
Message-ID: <17211.139.119978.52725@gargle.gargle.HOWL> (raw)
In-Reply-To: <52irwlmb1y.fsf@cisco.com>

Roland Dreier writes:
 >     Arjan> this is really ugly though; at minimum a DEFINE_STATIC_SPINLOCK()
 >     Arjan>  would be needed to make this less ugly.
 > 
 > huh?  This is a totally standard kernel idiom -- just do
 > 
 >     grep -Er 'static (DECLARE|DEFINE)' .
 > 
 > in a kernel tree to see how prevalent it is.

It may be widely used and still ugly. The general problem with
DEFINE_FOO() macros is that they obfuscate things: they do not _look_
like C variable declarations, and, in particular, type of variable is
not immediately obvious.

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

The question is: does RT really have to force DEFINE_* as the only way
to define things?

 > 
 >  - R.

Nikita.

  reply	other threads:[~2005-09-28 20:43 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 [this message]
2005-09-29  6:49       ` Steven Rostedt

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=17211.139.119978.52725@gargle.gargle.HOWL \
    --to=nikita@clusterfs.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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®