Skip to contentSkip to conversation

PI-futex: futex code cleanups

PATCH In review Ingo Molnar 1 participant 1 message Mar 25, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/10 PI-futex: futex code cleanups

From: Ingo Molnar <[email protected]>

clean up the futex code, before adding more features to it:

- use u32 as the futex field type - that's the ABI
- use __user and pointers to u32 instead of unsigned long
- code style / comment style cleanups
- rename hash-bucket name from 'bh' to 'hb'.

I checked the pre and post futex.o object files to make sure this patch has no code effects.

----

 include/linux/futex.h    |    5 
 include/linux/syscalls.h |    4 
 kernel/futex.c           |  245 ++++++++++++++++++++++++-----------------------
 3 files changed, 134 insertions(+), 120 deletions(-)
include/linux/futex.h +2 -3
Index: linux-pi-futex.mm.q/include/linux/futex.h
===================================================================
@@ -90,9 +90,8 @@ struct robust_list_head {
  */
 #define ROBUST_LIST_LIMIT	2048
 
-long do_futex(unsigned long uaddr, int op, int val,
-		unsigned long timeout, unsigned long uaddr2, int val2,
-		int val3);
+long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
+	      u32 __user *uaddr2, u32 val2, u32 val3);
 
 extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr);
 
include/linux/syscalls.h +2 -2
Index: linux-pi-futex.mm.q/include/linux/syscalls.h
===================================================================
@@ -174,9 +174,9 @@ asmlinkage long sys_waitid(int which, pi
 			   int options, struct rusage __user *ru);
 asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options);
 asmlinkage long sys_set_tid_address(int __user *tidptr);
-asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
+asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val,
 			struct timespec __user *utime, u32 __user *uaddr2,
-			int val3);
+			u32 val3);
 
 asmlinkage long sys_init_module(void __user *umod, unsigned long len,
 				const char __user *uargs);
kernel/futex.c +130 -115

563 lines not on this page · raw message