[COMMITTED] nptl/nptl-init.c: Use ALIGN_UP.
diff mbox

Message ID 547965E0.7040007@redhat.com
State New
Headers show

Commit Message

Carlos O'Donell Nov. 29, 2014, 6:21 a.m. UTC
Continue to use ALIGN_UP everywhere we have
random operations to align values to certain
boundaries. This makes code easier to read
and doesn't change the generated code (depends
exactly on which pattern you're replacing).

2014-11-29  Carlos O'Donell  <carlos@redhat.com>
 
	* nptl/nptl-init.c: Include libc-internal.h.
	(__pthread_initialize_minimal_internal): Use ROUND_UP.
 
---

Cheers,
Carlos.

Patch
diff mbox

diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 831d762..dcb77c5 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -35,7 +35,7 @@ 
 #include <smp.h>
 #include <lowlevellock.h>
 #include <kernel-features.h>
-
+#include <libc-internal.h>
 
 #ifndef TLS_MULTIPLE_THREADS_IN_TCB
 /* Pointer to the corresponding variable in libc.  */
@@ -451,7 +451,7 @@  __pthread_initialize_minimal_internal (void)
     limit.rlim_cur = minstack;
 
   /* Round the resource limit up to page size.  */
-  limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz;
+  limit.rlim_cur = ALIGN_UP (limit.rlim_cur, pagesz);
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   __default_pthread_attr.stacksize = limit.rlim_cur;
   __default_pthread_attr.guardsize = GLRO (dl_pagesize);