[parisc-linux] [2.6 PATCH][PARISC] atomic_read()

Mitchell Blank Jr mitch@sfgoth.com
Sun, 21 Sep 2003 23:11:25 -0700


A patch was recently accepted into the main 2.6 tree that makes skb_cloned()
and skb_shared() take a "const" pointer.  These functions call atomic_read()
so it needs to take a const pointer too.  After some discussion on netdev
davem said that this should be safe (even in the pessimal case of a
spinlock-implemented atomic_t we should be able to read its value outside
the lock safely)

PA-RISC uses an inline fucntion for atomic_read() but it doesn't mark its
argument as const, so without this patch you'll start seeing lots of new
compile warnings.

Please apply.  The patch is versus a week ago but the file hasn't changed so
it should apply fine.  It isn't compile tested but it shouldn't cause any
problems.

-Mitch

--- linux-2.6.0-test5-bk3-mnb2/include/asm-parisc/atomic.h	2003-09-12 15:46:35.000000000 -0700
+++ linux-2.6.0-test5-bk3-mnb3/include/asm-parisc/atomic.h	2003-09-21 16:07:11.782837264 -0700
@@ -154,7 +154,7 @@
 	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(v), flags);
 }
 
-static __inline__ int __atomic_read(atomic_t *v)
+static __inline__ int __atomic_read(const atomic_t *v)
 {
 	return v->counter;
 }