mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: config: use atleast2() instead of my_popcountl() where relevant
Quite often we used my_popcountl() just to check for > 1 bit set. Now we have an easier solution, let's use it.
This commit is contained in:
parent
98d334bd94
commit
9504dd64c6
@ -1664,7 +1664,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
|||||||
}
|
}
|
||||||
*slash = '/';
|
*slash = '/';
|
||||||
|
|
||||||
if (autoinc && my_popcountl(proc) != 1 && my_popcountl(thread) != 1) {
|
if (autoinc && atleast2(proc) && atleast2(thread)) {
|
||||||
ha_alert("parsing [%s:%d] : %s : '%s' : unable to automatically bind "
|
ha_alert("parsing [%s:%d] : %s : '%s' : unable to automatically bind "
|
||||||
"a process range _AND_ a thread range\n",
|
"a process range _AND_ a thread range\n",
|
||||||
file, linenum, args[0], args[1]);
|
file, linenum, args[0], args[1]);
|
||||||
@ -8824,7 +8824,7 @@ int check_config_validity()
|
|||||||
mask &= bind_conf->bind_proc;
|
mask &= bind_conf->bind_proc;
|
||||||
|
|
||||||
/* stop here if more than one process is used */
|
/* stop here if more than one process is used */
|
||||||
if (my_popcountl(mask) > 1)
|
if (atleast2(mask))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (&bind_conf->by_fe != &global.stats_fe->conf.bind) {
|
if (&bind_conf->by_fe != &global.stats_fe->conf.bind) {
|
||||||
@ -8973,7 +8973,7 @@ int check_config_validity()
|
|||||||
bind_conf->xprt->destroy_bind_conf(bind_conf);
|
bind_conf->xprt->destroy_bind_conf(bind_conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (my_popcountl(curproxy->bind_proc & nbits(global.nbproc)) > 1) {
|
if (atleast2(curproxy->bind_proc & nbits(global.nbproc))) {
|
||||||
if (curproxy->uri_auth) {
|
if (curproxy->uri_auth) {
|
||||||
int count, maxproc = 0;
|
int count, maxproc = 0;
|
||||||
|
|
||||||
@ -9072,7 +9072,7 @@ int check_config_validity()
|
|||||||
ha_warning("Removing incomplete section 'peers %s' (no peer named '%s').\n",
|
ha_warning("Removing incomplete section 'peers %s' (no peer named '%s').\n",
|
||||||
curpeers->id, localpeer);
|
curpeers->id, localpeer);
|
||||||
}
|
}
|
||||||
else if (my_popcountl(curpeers->peers_fe->bind_proc) != 1) {
|
else if (atleast2(curpeers->peers_fe->bind_proc)) {
|
||||||
/* either it's totally stopped or too much used */
|
/* either it's totally stopped or too much used */
|
||||||
if (curpeers->peers_fe->bind_proc) {
|
if (curpeers->peers_fe->bind_proc) {
|
||||||
ha_alert("Peers section '%s': peers referenced by sections "
|
ha_alert("Peers section '%s': peers referenced by sections "
|
||||||
|
Loading…
Reference in New Issue
Block a user