Thread (8 messages) 8 messages, 5 authors, 2011-12-05

[PATCHv5] atomic: add *_dec_not_zero

From: sven@narfation.org (Sven Eckelmann)
Date: 2011-12-04 21:49:10
Also in: batman, linux-alpha, linux-arch, linux-mips, linux-um, linuxppc-dev

On Sunday 04 December 2011 21:33:16 Russell King - ARM Linux wrote:
[...]
quoted
+#define atomic64_dec_not_zero(v)	atomic64_add_unless((v), -1LL, 0LL)
I think this is rather silly - all these definitions are very similar to
each other.  Is there really no way to put this into include/linux/atomic.h,
maybe as something like:

#ifndef atomic64_dec_not_zero
#define atomic64_dec_not_zero(v)	atomic64_add_unless((v), -1, 0)
#endif

and avoid having to add essentially the same definition to 12 individual
files?

Architectures which want to override it can do by the following:

#define atomic64_dec_not_zero		atomic64_dec_not_zero

which won't have any effect on C nor asm code.
 * https://lkml.org/lkml/2011/5/8/15
 * https://lkml.org/lkml/2011/5/8/16
 * https://lkml.org/lkml/2011/5/8/321

Kind regards,
	Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20111204/28763fec/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help