mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: trivial@kernel.org
Subject: [PATCH] atomic.h : atomic_t "counter" members should be volatile
Date: Mon, 30 Oct 2006 16:20:55 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610301616160.13077@localhost.localdomain> (raw)


Make sure all typedef struct's for atomic_t have a "volatile" counter
member.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
---
  According to what I read, it's highly recommended that that counter
member be declared with storage class "volatile".  This patch just
makes it consistently volatile across all architectures.

 asm-frv/atomic.h       |    2 +-
 asm-h8300/atomic.h     |    2 +-
 asm-m68k/atomic.h      |    2 +-
 asm-m68knommu/atomic.h |    2 +-
 asm-v850/atomic.h      |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h
index 066386a..df564bb 100644
--- a/include/asm-frv/atomic.h
+++ b/include/asm-frv/atomic.h
@@ -35,7 +35,7 @@ #define smp_mb__before_atomic_inc()	barr
 #define smp_mb__after_atomic_inc()	barrier()

 typedef struct {
-	int counter;
+	volatile int counter;
 } atomic_t;

 #define ATOMIC_INIT(i)		{ (i) }
diff --git a/include/asm-h8300/atomic.h b/include/asm-h8300/atomic.h
index 21f5442..3436bda 100644
--- a/include/asm-h8300/atomic.h
+++ b/include/asm-h8300/atomic.h
@@ -6,7 +6,7 @@ #define __ARCH_H8300_ATOMIC__
  * resource counting etc..
  */

-typedef struct { int counter; } atomic_t;
+typedef struct { volatile int counter; } atomic_t;
 #define ATOMIC_INIT(i)	{ (i) }

 #define atomic_read(v)		((v)->counter)
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h
index d5eed64..4a8c625 100644
--- a/include/asm-m68k/atomic.h
+++ b/include/asm-m68k/atomic.h
@@ -13,7 +13,7 @@ #include <asm/system.h>	/* local_irq_XXX
  * We do not have SMP m68k systems, so we don't have to deal with that.
  */

-typedef struct { int counter; } atomic_t;
+typedef struct { volatile int counter; } atomic_t;
 #define ATOMIC_INIT(i)	{ (i) }

 #define atomic_read(v)		((v)->counter)
diff --git a/include/asm-m68knommu/atomic.h b/include/asm-m68knommu/atomic.h
index 6c4e4b6..c77e601 100644
--- a/include/asm-m68knommu/atomic.h
+++ b/include/asm-m68knommu/atomic.h
@@ -12,7 +12,7 @@ #include <asm/system.h>	/* local_irq_XXX
  * We do not have SMP m68k systems, so we don't have to deal with that.
  */

-typedef struct { int counter; } atomic_t;
+typedef struct { volatile int counter; } atomic_t;
 #define ATOMIC_INIT(i)	{ (i) }

 #define atomic_read(v)		((v)->counter)
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h
index e4e57de..527480e 100644
--- a/include/asm-v850/atomic.h
+++ b/include/asm-v850/atomic.h
@@ -21,7 +21,7 @@ #ifdef CONFIG_SMP
 #error SMP not supported
 #endif

-typedef struct { int counter; } atomic_t;
+typedef struct { volatile int counter; } atomic_t;

 #define ATOMIC_INIT(i)	{ (i) }


                 reply	other threads:[~2006-10-30 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.64.0610301616160.13077@localhost.localdomain \
    --to=rpjday@mindspring.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /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®