diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-02-15 06:17:09 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-02-15 06:19:13 -0500 |
commit | 81b40539e748b108d143a5e38526ab00a6a784b6 (patch) | |
tree | 7e63d9d2e0021d6631301f9762b31ed99f05c40f /kernel/futex.c | |
parent | 59263b513c11398cd66a52d4c5b2b118ce1e0359 (diff) |
futex: Simplify return logic
No need to assign ret in each case and break. Simply return the result
of the handler function directly.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 4b1c4b6a339c..2364c99dd982 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -2616,7 +2616,7 @@ void exit_robust_list(struct task_struct *curr) | |||
2616 | long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, | 2616 | long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, |
2617 | u32 __user *uaddr2, u32 val2, u32 val3) | 2617 | u32 __user *uaddr2, u32 val2, u32 val3) |
2618 | { | 2618 | { |
2619 | int ret = -ENOSYS, cmd = op & FUTEX_CMD_MASK; | 2619 | int cmd = op & FUTEX_CMD_MASK; |
2620 | unsigned int flags = 0; | 2620 | unsigned int flags = 0; |
2621 | 2621 | ||
2622 | if (!(op & FUTEX_PRIVATE_FLAG)) | 2622 | if (!(op & FUTEX_PRIVATE_FLAG)) |
@@ -2642,43 +2642,31 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, | |||
2642 | case FUTEX_WAIT: | 2642 | case FUTEX_WAIT: |
2643 | val3 = FUTEX_BITSET_MATCH_ANY; | 2643 | val3 = FUTEX_BITSET_MATCH_ANY; |
2644 | case FUTEX_WAIT_BITSET: | 2644 | case FUTEX_WAIT_BITSET: |
2645 | ret = futex_wait(uaddr, flags, val, timeout, val3); | 2645 | return futex_wait(uaddr, flags, val, timeout, val3); |
2646 | break; | ||
2647 | case FUTEX_WAKE: | 2646 | case FUTEX_WAKE: |
2648 | val3 = FUTEX_BITSET_MATCH_ANY; | 2647 | val3 = FUTEX_BITSET_MATCH_ANY; |
2649 | case FUTEX_WAKE_BITSET: | 2648 | case FUTEX_WAKE_BITSET: |
2650 | ret = futex_wake(uaddr, flags, val, val3); | 2649 | return futex_wake(uaddr, flags, val, val3); |
2651 | break; | ||
2652 | case FUTEX_REQUEUE: | 2650 | case FUTEX_REQUEUE: |
2653 | ret = futex_requeue(uaddr, flags, uaddr2, val, val2, NULL, 0); | 2651 | return futex_requeue(uaddr, flags, uaddr2, val, val2, NULL, 0); |
2654 | break; | ||
2655 | case FUTEX_CMP_REQUEUE: | 2652 | case FUTEX_CMP_REQUEUE: |
2656 | ret = futex_requeue(uaddr, flags, uaddr2, val, val2, &val3, 0); | 2653 | return futex_requeue(uaddr, flags, uaddr2, val, val2, &val3, 0); |
2657 | break; | ||
2658 | case FUTEX_WAKE_OP: | 2654 | case FUTEX_WAKE_OP: |
2659 | ret = futex_wake_op(uaddr, flags, uaddr2, val, val2, val3); | 2655 | return futex_wake_op(uaddr, flags, uaddr2, val, val2, val3); |
2660 | break; | ||
2661 | case FUTEX_LOCK_PI: | 2656 | case FUTEX_LOCK_PI: |
2662 | ret = futex_lock_pi(uaddr, flags, val, timeout, 0); | 2657 | return futex_lock_pi(uaddr, flags, val, timeout, 0); |
2663 | break; | ||
2664 | case FUTEX_UNLOCK_PI: | 2658 | case FUTEX_UNLOCK_PI: |
2665 | ret = futex_unlock_pi(uaddr, flags); | 2659 | return futex_unlock_pi(uaddr, flags); |
2666 | break; | ||
2667 | case FUTEX_TRYLOCK_PI: | 2660 | case FUTEX_TRYLOCK_PI: |
2668 | ret = futex_lock_pi(uaddr, flags, 0, timeout, 1); | 2661 | return futex_lock_pi(uaddr, flags, 0, timeout, 1); |
2669 | break; | ||
2670 | case FUTEX_WAIT_REQUEUE_PI: | 2662 | case FUTEX_WAIT_REQUEUE_PI: |
2671 | val3 = FUTEX_BITSET_MATCH_ANY; | 2663 | val3 = FUTEX_BITSET_MATCH_ANY; |
2672 | ret = futex_wait_requeue_pi(uaddr, flags, val, timeout, val3, | 2664 | return futex_wait_requeue_pi(uaddr, flags, val, timeout, val3, |
2673 | uaddr2); | 2665 | uaddr2); |
2674 | break; | ||
2675 | case FUTEX_CMP_REQUEUE_PI: | 2666 | case FUTEX_CMP_REQUEUE_PI: |
2676 | ret = futex_requeue(uaddr, flags, uaddr2, val, val2, &val3, 1); | 2667 | return futex_requeue(uaddr, flags, uaddr2, val, val2, &val3, 1); |
2677 | break; | ||
2678 | default: | ||
2679 | ret = -ENOSYS; | ||
2680 | } | 2668 | } |
2681 | return ret; | 2669 | return -ENOSYS; |
2682 | } | 2670 | } |
2683 | 2671 | ||
2684 | 2672 | ||