patch-2.1.37 linux/include/asm-sparc/semaphore.h

Next file: linux/include/asm-sparc/smp.h
Previous file: linux/include/asm-sparc/processor.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/include/asm-sparc/semaphore.h linux/include/asm-sparc/semaphore.h
@@ -28,20 +28,18 @@
  * XXX spinlock can allow this to be done without grabbing the IRQ
  * XXX global lock.
  */
-static inline int waking_non_zero(struct semaphore *sem)
-{
-	unsigned long flags;
-	int ret = 0;
-
-	save_flags(flags);
-	cli();
-	if (atomic_read(&sem->waking) > 0) {
-		atomic_dec(&sem->waking);
-		ret = 1;
-	}
-	restore_flags(flags);
-	return ret;
-}
+#define waking_non_zero(sem) \
+({	unsigned long flags; \
+	int ret = 0; \
+	save_flags(flags); \
+	cli(); \
+	if (atomic_read(&sem->waking) > 0) { \
+		atomic_dec(&sem->waking); \
+		ret = 1; \
+	} \
+	restore_flags(flags); \
+	ret; \
+})
 
 /* This isn't quite as clever as the x86 side, I'll be fixing this
  * soon enough.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov