Thread (10 messages) flat view 10 messages, 6 authors, 2007-08-13

Re: [PATCH 9/24] make atomic_read() behave consistently on ia64

From: Chris Snook <hidden>
Date: 2007-08-10 23:16:25
Also in: linux-arch, lkml

Possibly related (same subject, not in this thread)

Linus Torvalds wrote:
On Fri, 10 Aug 2007, Luck, Tony wrote:
quoted
Here are the functions in which they occur in the object file. You
may have to chase down some inlining to find the function that
actually uses atomic_*().
Could you just make the "atomic_read()" and "atomic_set()" functions be 
inline functions instead?

That way you get nice compiler warnings when you pass the wrong kind of 
object around.  So

	static void atomic_set(atomic_t *p, int value)
	{
		*(volatile int *)&p->value = value;
	}

	static int atomic_read(atomic_t *p)
	{
		return *(volatile int *)&p->value;
	}

etc...
I'll do this for the whole patchset.  Stay tuned for the resubmit.

	-- Chris
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help