util: Trivial cleanup in the BSD code of util_cpu_detect_once

This code is going to be replicated in future commits, so tidy up a bit
first.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11228>
This commit is contained in:
Ian Romanick 2021-06-08 15:33:39 -07:00 committed by Marge Bot
parent 1786e847d9
commit 44246892a0

View file

@ -571,13 +571,10 @@ util_cpu_detect_once(void)
util_cpu_caps.nr_cpus = 1;
# elif defined(PIPE_OS_BSD)
{
int mib[2], ncpu;
int len;
const int mib[] = { CTL_HW, HW_NCPU };
int ncpu;
int len = sizeof(ncpu);
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
len = sizeof (ncpu);
sysctl(mib, 2, &ncpu, &len, NULL, 0);
util_cpu_caps.nr_cpus = ncpu;
}