mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* why is it called "asm-generic/atomic.h"?
@ 2007-06-07 12:28 Robert P. J. Day
  2007-06-07 15:31 ` Stefan Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2007-06-07 12:28 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  i'm just curious -- why does that particular header file have that
name?  its opening comment reads:

 * Allows to provide arch independent atomic definitions without the need to
 * edit all arch specific atomic.h files.

but that's *not* what that header file does.  rather, it simply
defines the "long" form of the atomic operations that can be used *in
addition to* the arch-specific ones.

  wouldn't it make more sense to have called that header file
something like "asm-generic/atomic_long.h", so as not to mislead folks
into thinking it represented an *alternative* to those other header
files?

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: why is it called "asm-generic/atomic.h"?
  2007-06-07 12:28 why is it called "asm-generic/atomic.h"? Robert P. J. Day
@ 2007-06-07 15:31 ` Stefan Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Richter @ 2007-06-07 15:31 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

Robert P. J. Day wrote:
>   i'm just curious -- why does that particular header file have that
> name?  its opening comment reads:
> 
>  * Allows to provide arch independent atomic definitions without the need to
>  * edit all arch specific atomic.h files.
> 
> but that's *not* what that header file does.

The file name is correct, and the comment is correct too.  It indeed
_allows_ to define architecture-independent operations on atomic types,
and it currently does so for atomic_long_t.  There is no need to do so
for atomic_t, because all architectures already had their own set of
atomic_t operations when asm-generic/atomic.h was added.  (And I presume
they varied too much to justify an additional generic implementation
plus #ifndef HAVE_ARCH_SOMETHING games.)

PS:  The atomic_long_t operations currently don't need to be protected
by #ifndef HAVE_ARCH_SOMETHING and won't need to be in foreseeable
future, therefore they don't have this protection.
-- 
Stefan Richter
-=====-=-=== -==- --===
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-07 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-07 12:28 why is it called "asm-generic/atomic.h"? Robert P. J. Day
2007-06-07 15:31 ` Stefan Richter

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®