All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: laurent@vivier.eu, philmd@redhat.com
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
	Li Qiang <liq3ea@gmail.com>
Subject: [Qemu-trivial] [PATCH] util: vfio-helpers: use ARRAY_SIZE in qemu_vfio_init_pci()
Date: Fri, 30 Nov 2018 01:53:58 -0800	[thread overview]
Message-ID: <1543571638-2892-1-git-send-email-liq3ea@gmail.com> (raw)

Cc: qemu-trivial@nongnu.org

Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
 util/vfio-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.11.0



             reply	other threads:[~2018-11-30  9:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30  9:53 Li Qiang [this message]
2018-11-30 12:01 ` [Qemu-trivial] [PATCH] util: vfio-helpers: use ARRAY_SIZE in qemu_vfio_init_pci() Philippe Mathieu-Daudé
2018-11-30 12:58   ` Laurent Vivier
2018-11-30 19:38     ` Michael Tokarev
2018-12-07 11:15 ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543571638-2892-1-git-send-email-liq3ea@gmail.com \
    --to=liq3ea@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.