From fc647360e0ec520cf824c53fb023fff6fb4846ef Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 2 Feb 2019 17:05:03 +0100 Subject: [PATCH] CLEANUP: threads: use nbits to calculate the thread mask It's pointless to do arithmetics by hand, we have a function for this. --- src/hathreads.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hathreads.c b/src/hathreads.c index a21bddd9e..8a4085ee6 100644 --- a/src/hathreads.c +++ b/src/hathreads.c @@ -157,9 +157,7 @@ int parse_nbthread(const char *arg, char **err) return 0; } - /* we proceed like this to be sure never to overflow the left shift */ - all_threads_mask = 1UL << (nbthread - 1); - all_threads_mask |= all_threads_mask - 1; + all_threads_mask = nbits(nbthread); #endif return nbthread; }