diff mbox series

Simplify an #if #else #endif.

Message ID b8JC7_9fXMDVDWSJowZ-1KtsNIq1-xI-T8vQ1ynQJqrJV90h_3Q2QPXaxip1xUjjbRtMeG6nmZ71_xZz7VSkwjRFxLmxp-XlMHIZ82_5h88=@espindo.la
State New
Headers show
Series Simplify an #if #else #endif. | expand

Commit Message

Rafael Ávila de Espíndola Oct. 10, 2018, 4:15 a.m. UTC
The #else of two nested #if clauses were identical.
---

This also makes the followup patches for VDSO handling easier to read.

2018-10-09  Rafael Ávila de Espíndola  <rafael@espindo.la>

        [BZ #19767]
        * sysdeps/unix/sysv/linux/sysdep-vdso.h: Merge nested #if.

Comments

Rafael Ávila de Espíndola Oct. 14, 2018, 5:30 p.m. UTC | #1
ping?

"Rafael Avila de Espindola" <rafael@espindo.la> writes:

> The #else of two nested #if clauses were identical.
> ---
>
> This also makes the followup patches for VDSO handling easier to read.
>
> 2018-10-09  Rafael Ávila de Espíndola  <rafael@espindo.la>
>
>         [BZ #19767]
>         * sysdeps/unix/sysv/linux/sysdep-vdso.h: Merge nested #if.
>
>
> diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> index 1912c1c156..7ec175c4c4 100644
> --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
> +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> @@ -26,13 +26,11 @@
>       funcptr (args)
>  #endif
>  
> -#ifdef SHARED
> +#if defined SHARED && defined HAVE_VSYSCALL
>  
> -# ifdef HAVE_VSYSCALL
> +# include <libc-vdso.h>
>  
> -#  include <libc-vdso.h>
> -
> -#  define INLINE_VSYSCALL(name, nr, args...)				      \
> +# define INLINE_VSYSCALL(name, nr, args...)				      \
>    ({									      \
>      __label__ out;							      \
>      __label__ iserr;							      \
> @@ -61,7 +59,7 @@
>      sc_ret;								      \
>    })
>  
> -#  define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
> +# define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
>    ({									      \
>      __label__ out;							      \
>      long v_ret;								      \
> @@ -79,20 +77,13 @@
>    out:									      \
>      v_ret;								      \
>    })
> -# else
> -#  define INLINE_VSYSCALL(name, nr, args...) \
> -    INLINE_SYSCALL (name, nr, ##args)
> -#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
> -    INTERNAL_SYSCALL (name, err, nr, ##args)
> -# endif /* HAVE_VSYSCALL  */
> -
> -# else /* SHARED  */
> +#else
>  
>  #  define INLINE_VSYSCALL(name, nr, args...) \
>      INLINE_SYSCALL (name, nr, ##args)
>  #  define INTERNAL_VSYSCALL(name, err, nr, args...) \
>      INTERNAL_SYSCALL (name, err, nr, ##args)
>  
> -#endif /* SHARED  */
> +#endif /* defined SHARED && defined HAVE_VSYSCALL */
>  
>  #endif /* SYSDEP_VDSO_LINUX_H  */
> -- 
> 2.17.1
Szabolcs Nagy Oct. 15, 2018, 10:38 a.m. UTC | #2
On 14/10/18 18:30, Rafael Avila de Espindola wrote:
> ping?
> 
> "Rafael Avila de Espindola" <rafael@espindo.la> writes:
> 
>> The #else of two nested #if clauses were identical.

looks good.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

>> ---
>>
>> This also makes the followup patches for VDSO handling easier to read.
>>
>> 2018-10-09  Rafael Ávila de Espíndola  <rafael@espindo.la>
>>
>>         [BZ #19767]
>>         * sysdeps/unix/sysv/linux/sysdep-vdso.h: Merge nested #if.
>>
>>
>> diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
>> index 1912c1c156..7ec175c4c4 100644
>> --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
>> +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
>> @@ -26,13 +26,11 @@
>>       funcptr (args)
>>  #endif
>>  
>> -#ifdef SHARED
>> +#if defined SHARED && defined HAVE_VSYSCALL
>>  
>> -# ifdef HAVE_VSYSCALL
>> +# include <libc-vdso.h>
>>  
>> -#  include <libc-vdso.h>
>> -
>> -#  define INLINE_VSYSCALL(name, nr, args...)				      \
>> +# define INLINE_VSYSCALL(name, nr, args...)				      \
>>    ({									      \
>>      __label__ out;							      \
>>      __label__ iserr;							      \
>> @@ -61,7 +59,7 @@
>>      sc_ret;								      \
>>    })
>>  
>> -#  define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
>> +# define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
>>    ({									      \
>>      __label__ out;							      \
>>      long v_ret;								      \
>> @@ -79,20 +77,13 @@
>>    out:									      \
>>      v_ret;								      \
>>    })
>> -# else
>> -#  define INLINE_VSYSCALL(name, nr, args...) \
>> -    INLINE_SYSCALL (name, nr, ##args)
>> -#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
>> -    INTERNAL_SYSCALL (name, err, nr, ##args)
>> -# endif /* HAVE_VSYSCALL  */
>> -
>> -# else /* SHARED  */
>> +#else
>>  
>>  #  define INLINE_VSYSCALL(name, nr, args...) \
>>      INLINE_SYSCALL (name, nr, ##args)
>>  #  define INTERNAL_VSYSCALL(name, err, nr, args...) \
>>      INTERNAL_SYSCALL (name, err, nr, ##args)
>>  
>> -#endif /* SHARED  */
>> +#endif /* defined SHARED && defined HAVE_VSYSCALL */
>>  
>>  #endif /* SYSDEP_VDSO_LINUX_H  */
>> -- 
>> 2.17.1
>
Rafael Ávila de Espíndola Oct. 23, 2018, 3:23 a.m. UTC | #3
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, October 15, 2018 3:38 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:

> On 14/10/18 18:30, Rafael Avila de Espindola wrote:
>
> > ping?
> > "Rafael Avila de Espindola" rafael@espindo.la writes:
> >
> > > The #else of two nested #if clauses were identical.
>
> looks good.

Could someone please commit it?

Thanks,
Rafael
Rafael Ávila de Espíndola Oct. 30, 2018, 9:58 p.m. UTC | #4
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, October 22, 2018 8:23 PM, Rafael Avila de Espindola <rafael@espindo.la> wrote:

> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, October 15, 2018 3:38 AM, Szabolcs Nagy szabolcs.nagy@arm.com wrote:
>
> > On 14/10/18 18:30, Rafael Avila de Espindola wrote:
> >
> > > ping?
> > > "Rafael Avila de Espindola" rafael@espindo.la writes:
> > >
> > > > The #else of two nested #if clauses were identical.
> >
> > looks good.
>
> Could someone please commit it?

ping

Cheers,
Rafael
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 1912c1c156..7ec175c4c4 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -26,13 +26,11 @@ 
      funcptr (args)
 #endif
 
-#ifdef SHARED
+#if defined SHARED && defined HAVE_VSYSCALL
 
-# ifdef HAVE_VSYSCALL
+# include <libc-vdso.h>
 
-#  include <libc-vdso.h>
-
-#  define INLINE_VSYSCALL(name, nr, args...)				      \
+# define INLINE_VSYSCALL(name, nr, args...)				      \
   ({									      \
     __label__ out;							      \
     __label__ iserr;							      \
@@ -61,7 +59,7 @@ 
     sc_ret;								      \
   })
 
-#  define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
+# define INTERNAL_VSYSCALL(name, err, nr, args...)			      \
   ({									      \
     __label__ out;							      \
     long v_ret;								      \
@@ -79,20 +77,13 @@ 
   out:									      \
     v_ret;								      \
   })
-# else
-#  define INLINE_VSYSCALL(name, nr, args...) \
-    INLINE_SYSCALL (name, nr, ##args)
-#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
-    INTERNAL_SYSCALL (name, err, nr, ##args)
-# endif /* HAVE_VSYSCALL  */
-
-# else /* SHARED  */
+#else
 
 #  define INLINE_VSYSCALL(name, nr, args...) \
     INLINE_SYSCALL (name, nr, ##args)
 #  define INTERNAL_VSYSCALL(name, err, nr, args...) \
     INTERNAL_SYSCALL (name, err, nr, ##args)
 
-#endif /* SHARED  */
+#endif /* defined SHARED && defined HAVE_VSYSCALL */
 
 #endif /* SYSDEP_VDSO_LINUX_H  */