mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 19:45:21 +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"
|
#include "util/virstring.h"
|
||||||
|
|
||||||
|
|
||||||
#define NR_DRIVERS ARRAY_CARDINALITY(drivers)
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_CPU
|
#define VIR_FROM_THIS VIR_FROM_CPU
|
||||||
|
|
||||||
VIR_LOG_INIT("cpu.cpu");
|
VIR_LOG_INIT("cpu.cpu");
|
||||||
@ -60,7 +59,7 @@ cpuGetSubDriver(virArch arch)
|
|||||||
return NULL;
|
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++) {
|
for (j = 0; j < drivers[i]->narch; j++) {
|
||||||
if (arch == drivers[i]->arch[j])
|
if (arch == drivers[i]->arch[j])
|
||||||
return drivers[i];
|
return drivers[i];
|
||||||
@ -79,7 +78,7 @@ cpuGetSubDriverByName(const char *name)
|
|||||||
{
|
{
|
||||||
size_t i;
|
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))
|
if (STREQ_NULLABLE(name, drivers[i]->name))
|
||||||
return drivers[i];
|
return drivers[i];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user