mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
cpu: Drop NR_DRIVERS macro
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
3e5197ac13
commit
6ec4e28ecd
@ -35,7 +35,6 @@
|
||||
#include "util/virstring.h"
|
||||
|
||||
|
||||
#define NR_DRIVERS ARRAY_CARDINALITY(drivers)
|
||||
#define VIR_FROM_THIS VIR_FROM_CPU
|
||||
|
||||
VIR_LOG_INIT("cpu.cpu");
|
||||
@ -60,7 +59,7 @@ cpuGetSubDriver(virArch arch)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < NR_DRIVERS; i++) {
|
||||
for (i = 0; i < ARRAY_CARDINALITY(drivers); i++) {
|
||||
for (j = 0; j < drivers[i]->narch; j++) {
|
||||
if (arch == drivers[i]->arch[j])
|
||||
return drivers[i];
|
||||
@ -79,7 +78,7 @@ cpuGetSubDriverByName(const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < NR_DRIVERS; i++) {
|
||||
for (i = 0; i < ARRAY_CARDINALITY(drivers); i++) {
|
||||
if (STREQ_NULLABLE(name, drivers[i]->name))
|
||||
return drivers[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user