Get rid of superfluous assignments
Carlos O'Donell
carlos@systemhalted.org
Wed Mar 7 14:59:00 GMT 2012
Thomas,
I see that this is already checked into trunk,
but I thought I'd do a review to double check
and point out that you could merge your years.
On Mon, Feb 6, 2012 at 6:21 AM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> Hi!
>
> nptl/
> 2012-01-23 Thomas Schwinge <thomas@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Get rid of
> superfluous assignment.
> * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c (sem_timedwait):
> Likewise.
> * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
> (sem_timedwait): Likewise.
>
> diff --git a/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c b/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
> index cb3b78f..cbb56d0 100644
> --- a/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
> +++ b/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c
> @@ -1,5 +1,5 @@
> /* sem_timedwait -- wait on a semaphore. Generic futex-using version.
> - Copyright (C) 2003, 2007 Free Software Foundation, Inc.
> + Copyright (C) 2003, 2007, 2012 Free Software Foundation, Inc.
Merge years e.g. 2003-2012.
> This file is part of the GNU C Library.
> Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
>
> @@ -84,7 +84,6 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
> }
>
> /* Already timed out? */
> - err = -ETIMEDOUT;
> if (sec < 0)
> {
> __set_errno (ETIMEDOUT);
OK.
> diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c b/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
> index fdd09af..eb2beda 100644
> --- a/nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
> +++ b/nptl/
> @@ -1,5 +1,5 @@
> /* sem_timedwait -- wait on a semaphore. Generic futex-using version.
> - Copyright (C) 2003, 2007 Free Software Foundation, Inc.
> + Copyright (C) 2003, 2007, 2012 Free Software Foundation, Inc.
Merge years.
> This file is part of the GNU C Library.
> Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
>
> @@ -84,7 +84,6 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
> }
>
> /* Already timed out? */
> - err = -ETIMEDOUT;
> if (sec < 0)
> {
> __set_errno (ETIMEDOUT);
OK.
> diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
> index 90edbc5..4410554 100644
> --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
> +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
> @@ -1,5 +1,5 @@
> /* sem_timedwait -- wait on a semaphore. SPARC version.
> - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
> + Copyright (C) 2003, 2006, 2007, 2012 Free Software Foundation, Inc.
Merge years.
> This file is part of the GNU C Library.
> Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
>
> @@ -103,7 +103,6 @@ sem_timedwait (sem_t *sem, const struct timespec *abstime)
> }
>
> /* Already timed out? */
> - err = -ETIMEDOUT;
> if (sec < 0)
> {
> __set_errno (ETIMEDOUT);
OK.
The setting of err to -ETIMEDOUT is a dead store since
it's set again to -1 before exit or reused as the
return value to the futex call.
Looked good to me (already committed by Ulrich).
Cheers,
Carlos.
More information about the Libc-alpha
mailing list