Received: from eggs.gnu.org ([2001:4830:134:3::10]:52958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpE7C-0001YD-Cs for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpE78-0006cu-7Q for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:37:33 -0400 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 28 Sep 2016 16:37:20 +0400 Message-Id: <20160928123720.21171-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] exec: remove unused compacted argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com, qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Since commit b35ba30f8f when it was introduced, phys_page_compact() takes an unused compacted argument. ubsan complains about it when launching qemu-x86_64 without arguments: qemu/exec.c:310:5: runtime error: variable length array bound evaluates t= o non-positive value 0 Signed-off-by: Marc-Andr=C3=A9 Lureau --- exec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exec.c b/exec.c index c81d5ab..fc7e902 100644 --- a/exec.c +++ b/exec.c @@ -255,7 +255,7 @@ static void phys_page_set(AddressSpaceDispatch *d, /* Compact a non leaf page entry. Simply detect that the entry has a sin= gle child, * and update our entry so we can skip it and go directly to the destina= tion. */ -static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned l= ong *compacted) +static void phys_page_compact(PhysPageEntry *lp, Node *nodes) { unsigned valid_ptr =3D P_L2_SIZE; int valid =3D 0; @@ -275,7 +275,7 @@ static void phys_page_compact(PhysPageEntry *lp, Node= *nodes, unsigned long *com valid_ptr =3D i; valid++; if (p[i].skip) { - phys_page_compact(&p[i], nodes, compacted); + phys_page_compact(&p[i], nodes); } } =20 @@ -307,10 +307,8 @@ static void phys_page_compact(PhysPageEntry *lp, Nod= e *nodes, unsigned long *com =20 static void phys_page_compact_all(AddressSpaceDispatch *d, int nodes_nb) { - DECLARE_BITMAP(compacted, nodes_nb); - if (d->phys_map.skip) { - phys_page_compact(&d->phys_map, d->map.nodes, compacted); + phys_page_compact(&d->phys_map, d->map.nodes); } } =20 --=20 2.10.0