about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/dl-origin.c6
-rw-r--r--sysdeps/unix/sysv/linux/getsysstats.c4
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c4
-rw-r--r--sysdeps/unix/sysv/linux/x86/elision-conf.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/lowlevellock.h60
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h26
6 files changed, 50 insertions, 52 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c
index 052b9ed110..139022b02c 100644
--- a/sysdeps/unix/sysv/linux/dl-origin.c
+++ b/sysdeps/unix/sysv/linux/dl-origin.c
@@ -62,13 +62,13 @@ _dl_get_origin (void)
 	 a copy and strip out trailing slashes.  */
       if (GLRO(dl_origin_path) != NULL)
 	{
-	  size_t len = strlen (GLRO(dl_origin_path));
-	  result = (char *) malloc (len + 1);
+	  size_t path_len = strlen (GLRO(dl_origin_path));
+	  result = (char *) malloc (path_len + 1);
 	  if (result == NULL)
 	    result = (char *) -1;
 	  else
 	    {
-	      char *cp = __mempcpy (result, GLRO(dl_origin_path), len);
+	      char *cp = __mempcpy (result, GLRO(dl_origin_path), path_len);
 	      while (cp > result + 1 && cp[-1] == '/')
 		--cp;
 	      *cp = '\0';
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index 1746827e9e..22600f0226 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -144,11 +144,10 @@ __get_nprocs (void)
 
   const int flags = O_RDONLY | O_CLOEXEC;
   int fd = open_not_cancel_2 ("/sys/devices/system/cpu/online", flags);
-  char *l;
   int result = 0;
   if (fd != -1)
     {
-      l = next_line (fd, buffer, &cp, &re, buffer_end);
+      char *l = next_line (fd, buffer, &cp, &re, buffer_end);
       if (l != NULL)
 	do
 	  {
@@ -196,6 +195,7 @@ __get_nprocs (void)
     {
       result = 0;
 
+      char *l;
       while ((l = next_line (fd, buffer, &cp, &re, buffer_end)) != NULL)
 	/* The current format of /proc/stat has all the cpu* entries
 	   at the front.  We assume here that stays this way.  */
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index a47b2edcad..a952172cfa 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -734,8 +734,8 @@ getifaddrs_internal (struct ifaddrs **ifap)
 		 address, use the name from the interface entry.  */
 	      if (ifas[ifa_index].ifa.ifa_name == NULL)
 		{
-		  int idx = map_newlink (ifam->ifa_index - 1, ifas,
-					 map_newlink_data, newlink);
+                  idx = map_newlink (ifam->ifa_index - 1, ifas,
+                                     map_newlink_data, newlink);
 		  if (__glibc_unlikely (idx == -1))
 		    goto try_again;
 		  ifas[ifa_index].ifa.ifa_name = ifas[idx].ifa.ifa_name;
diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c
index 28e48d9e92..77757c66c5 100644
--- a/sysdeps/unix/sysv/linux/x86/elision-conf.c
+++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c
@@ -60,7 +60,7 @@ int __pthread_force_elision attribute_hidden;
 static void
 elision_init (int argc __attribute__ ((unused)),
 	      char **argv  __attribute__ ((unused)),
-	      char **environ)
+	      char **envp)
 {
   __elision_available = HAS_RTM;
 #ifdef ENABLE_LOCK_ELISION
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 55b4e16144..6f4e4495b1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -157,22 +157,22 @@
 #endif
 
 #define lll_trylock(futex) \
-  ({ int ret;								      \
+  ({ int _ret;								      \
      __asm __volatile (__lll_trylock_asm				      \
-		       : "=a" (ret), "=m" (futex)			      \
+		       : "=a" (_ret), "=m" (futex)			      \
 		       : "r" (LLL_LOCK_INITIALIZER_LOCKED), "m" (futex),      \
 			 "0" (LLL_LOCK_INITIALIZER)			      \
 		       : "memory");					      \
-     ret; })
+     _ret; })
 
 #define lll_cond_trylock(futex) \
-  ({ int ret;								      \
+  ({ int _ret;								      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %2, %1"			      \
-		       : "=a" (ret), "=m" (futex)			      \
+		       : "=a" (_ret), "=m" (futex)			      \
 		       : "r" (LLL_LOCK_INITIALIZER_WAITERS),		      \
 			 "m" (futex), "0" (LLL_LOCK_INITIALIZER)	      \
 		       : "memory");					      \
-     ret; })
+     _ret; })
 
 #if defined NOT_IN_libc || defined UP
 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %4, %2\n\t"		      \
@@ -189,7 +189,7 @@
 
 #define lll_lock(futex, private) \
   (void)								      \
-    ({ int ignore1, ignore2, ignore3;					      \
+    ({ int _ignore1, _ignore2, _ignore3;				      \
        if (__builtin_constant_p (private) && (private) == LLL_PRIVATE)	      \
 	 __asm __volatile (__lll_lock_asm_start				      \
 			   "1:\tlea %2, %%" RDI_LP "\n"			      \
@@ -199,8 +199,8 @@
 			   "4:\tadd $128, %%" RSP_LP "\n"		      \
 			   ".cfi_adjust_cfa_offset -128\n"		      \
 			   "24:"					      \
-			   : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),   \
-			     "=a" (ignore3)				      \
+			   : "=S" (_ignore1), "=&D" (_ignore2), "=m" (futex), \
+			     "=a" (_ignore3)				      \
 			   : "0" (1), "m" (futex), "3" (0)		      \
 			   : "cx", "r11", "cc", "memory");		      \
        else								      \
@@ -212,14 +212,14 @@
 			   "4:\tadd $128, %%" RSP_LP "\n"		      \
 			   ".cfi_adjust_cfa_offset -128\n"		      \
 			   "24:"					      \
-			   : "=S" (ignore1), "=D" (ignore2), "=m" (futex),    \
-			     "=a" (ignore3)				      \
+			   : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),  \
+			     "=a" (_ignore3)				      \
 			   : "1" (1), "m" (futex), "3" (0), "0" (private)     \
 			   : "cx", "r11", "cc", "memory");		      \
     })									      \
 
 #define lll_robust_lock(futex, id, private) \
-  ({ int result, ignore1, ignore2;					      \
+  ({ int _result, _ignore1, _ignore2;					      \
     __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"			      \
 		      "jz 24f\n"					      \
 		      "1:\tlea %2, %%" RDI_LP "\n"			      \
@@ -229,15 +229,15 @@
 		      "4:\tadd $128, %%" RSP_LP "\n"			      \
 		      ".cfi_adjust_cfa_offset -128\n"			      \
 		      "24:"						      \
-		      : "=S" (ignore1), "=D" (ignore2), "=m" (futex),	      \
-			"=a" (result)					      \
+		      : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),	      \
+			"=a" (_result)					      \
 		      : "1" (id), "m" (futex), "3" (0), "0" (private)	      \
 		      : "cx", "r11", "cc", "memory");			      \
-    result; })
+    _result; })
 
 #define lll_cond_lock(futex, private) \
   (void)								      \
-    ({ int ignore1, ignore2, ignore3;					      \
+    ({ int _ignore1, _ignore2, _ignore3;				      \
        __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"		      \
 			 "jz 24f\n"					      \
 			 "1:\tlea %2, %%" RDI_LP "\n"			      \
@@ -247,14 +247,14 @@
 			 "4:\tadd $128, %%" RSP_LP "\n"			      \
 			 ".cfi_adjust_cfa_offset -128\n"		      \
 			 "24:"						      \
-			 : "=S" (ignore1), "=D" (ignore2), "=m" (futex),      \
-			   "=a" (ignore3)				      \
+			 : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),    \
+			   "=a" (_ignore3)				      \
 			 : "1" (2), "m" (futex), "3" (0), "0" (private)	      \
 			 : "cx", "r11", "cc", "memory");		      \
     })
 
 #define lll_robust_cond_lock(futex, id, private) \
-  ({ int result, ignore1, ignore2;					      \
+  ({ int _result, _ignore1, _ignore2;					      \
     __asm __volatile (LOCK_INSTR "cmpxchgl %4, %2\n\t"			      \
 		      "jz 24f\n"					      \
 		      "1:\tlea %2, %%" RDI_LP "\n"			      \
@@ -264,15 +264,15 @@
 		      "4:\tadd $128, %%" RSP_LP "\n"			      \
 		      ".cfi_adjust_cfa_offset -128\n"			      \
 		      "24:"						      \
-		      : "=S" (ignore1), "=D" (ignore2), "=m" (futex),	      \
-			"=a" (result)					      \
+		      : "=S" (_ignore1), "=D" (_ignore2), "=m" (futex),	      \
+			"=a" (_result)					      \
 		      : "1" (id | FUTEX_WAITERS), "m" (futex), "3" (0),	      \
 			"0" (private)					      \
 		      : "cx", "r11", "cc", "memory");			      \
-    result; })
+    _result; })
 
 #define lll_timedlock(futex, timeout, private) \
-  ({ int result, ignore1, ignore2, ignore3;				      \
+  ({ int _result, _ignore1, _ignore2, _ignore3;				      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"			      \
 		       "jz 24f\n"					      \
 		       "1:\tlea %4, %%" RDI_LP "\n"			      \
@@ -283,12 +283,12 @@
 		       "4:\tadd $128, %%" RSP_LP "\n"			      \
 		       ".cfi_adjust_cfa_offset -128\n"			      \
 		       "24:"						      \
-		       : "=a" (result), "=D" (ignore1), "=S" (ignore2),	      \
-			 "=&d" (ignore3), "=m" (futex)			      \
+		       : "=a" (_result), "=D" (_ignore1), "=S" (_ignore2),    \
+			 "=&d" (_ignore3), "=m" (futex)			      \
 		       : "0" (0), "1" (1), "m" (futex), "m" (timeout),	      \
 			 "2" (private)					      \
 		       : "memory", "cx", "cc", "r10", "r11");		      \
-     result; })
+     _result; })
 
 extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 					 const struct timespec *timeout,
@@ -298,7 +298,7 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
   __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
 
 #define lll_robust_timedlock(futex, timeout, id, private) \
-  ({ int result, ignore1, ignore2, ignore3;				      \
+  ({ int _result, _ignore1, _ignore2, _ignore3;				      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %1, %4\n\t"			      \
 		       "jz 24f\n\t"					      \
 		       "1:\tlea %4, %%" RDI_LP "\n"			      \
@@ -309,12 +309,12 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
 		       "4:\tadd $128, %%" RSP_LP "\n"			      \
 		       ".cfi_adjust_cfa_offset -128\n"			      \
 		       "24:"						      \
-		       : "=a" (result), "=D" (ignore1), "=S" (ignore2),       \
-			 "=&d" (ignore3), "=m" (futex)			      \
+		       : "=a" (_result), "=D" (_ignore1), "=S" (_ignore2),    \
+			 "=&d" (_ignore3), "=m" (futex)			      \
 		       : "0" (0), "1" (id), "m" (futex), "m" (timeout),	      \
 			 "2" (private)					      \
 		       : "memory", "cx", "cc", "r10", "r11");		      \
-     result; })
+     _result; })
 
 #if defined NOT_IN_libc || defined UP
 # define __lll_unlock_asm_start LOCK_INSTR "decl %0\n\t"		      \
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 4a619dafeb..f062bdadb6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -217,30 +217,28 @@
 # undef INTERNAL_SYSCALL_DECL
 # define INTERNAL_SYSCALL_DECL(err) do { } while (0)
 
-# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS(name, err, nr, args...)			      \
   ({									      \
-    unsigned long int resultvar;					      \
+    unsigned long int ncs_result;					      \
     LOAD_ARGS_##nr (args)						      \
     LOAD_REGS_##nr							      \
-    asm volatile (							      \
-    "syscall\n\t"							      \
-    : "=a" (resultvar)							      \
-    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");		      \
-    (long int) resultvar; })
+    asm volatile ("syscall"						      \
+		  : "=a" (ncs_result)					      \
+		  : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");  \
+    (long int) ncs_result; })
 # undef INTERNAL_SYSCALL
 # define INTERNAL_SYSCALL(name, err, nr, args...) \
   INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
 
-# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...)		      \
   ({									      \
-    unsigned long int resultvar;					      \
+    unsigned long int ncs_result;					      \
     LOAD_ARGS_TYPES_##nr (args)						      \
     LOAD_REGS_TYPES_##nr (args)						      \
-    asm volatile (							      \
-    "syscall\n\t"							      \
-    : "=a" (resultvar)							      \
-    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");		      \
-    (long int) resultvar; })
+    asm volatile ("syscall"						      \
+		  : "=a" (ncs_result)					      \
+		  : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");  \
+    (long int) ncs_result; })
 # undef INTERNAL_SYSCALL_TYPES
 # define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
   INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)