From 9e722ebc0668d045dc65585e96954082eafedd99 Mon Sep 17 00:00:00 2001 From: Li Qiang Date: Fri, 30 Nov 2018 01:53:58 -0800 Subject: util: vfio-helpers: use ARRAY_SIZE in qemu_vfio_init_pci() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: qemu-trivial@nongnu.org Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <1543571638-2892-1-git-send-email-liq3ea@gmail.com> Signed-off-by: Laurent Vivier --- util/vfio-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/vfio-helpers.c') diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index cccc9cd42e..342d4a2285 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -348,7 +348,7 @@ static int qemu_vfio_init_pci(QEMUVFIOState *s, const char *device, goto fail; } - for (i = 0; i < 6; i++) { + for (i = 0; i < ARRAY_SIZE(s->bar_region_info); i++) { ret = qemu_vfio_pci_init_bar(s, i, errp); if (ret) { goto fail; -- cgit v1.2.3