From nobody Mon Feb 9 07:31:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518250103824247.78517250214566; Sat, 10 Feb 2018 00:08:23 -0800 (PST) Received: from localhost ([::1]:37598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekQCs-0004GS-Tr for importer@patchew.org; Sat, 10 Feb 2018 03:08:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekQ7o-00006H-D2 for qemu-devel@nongnu.org; Sat, 10 Feb 2018 03:03:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekQ7k-0000W4-I7 for qemu-devel@nongnu.org; Sat, 10 Feb 2018 03:03:08 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:47669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekQ7k-0000VK-9v; Sat, 10 Feb 2018 03:03:04 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8C6EE40C58; Sat, 10 Feb 2018 11:03:03 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 939F17B4; Sat, 10 Feb 2018 10:55:16 +0300 (MSK) Received: (nullmailer pid 22817 invoked by uid 1000); Sat, 10 Feb 2018 07:55:14 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sat, 10 Feb 2018 10:55:10 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 15/17] tests/hbitmap: use ARRAY_SIZE macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.co= cci Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Michael Tokarev Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: John Snow --- tests/test-hbitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index 9091c639b3..f29631f939 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitmap.c @@ -813,7 +813,7 @@ static void test_hbitmap_serialize_basic(TestHBitmapDat= a *data, size_t buf_size; uint8_t *buf; uint64_t positions[] =3D { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - = 1 }; - int num_positions =3D sizeof(positions) / sizeof(positions[0]); + int num_positions =3D ARRAY_SIZE(positions); =20 hbitmap_test_init(data, L3, 0); g_assert(hbitmap_is_serializable(data->hb)); @@ -838,7 +838,7 @@ static void test_hbitmap_serialize_part(TestHBitmapData= *data, size_t buf_size; uint8_t *buf; uint64_t positions[] =3D { 0, 1, L1 - 1, L1, L2 - 1, L2, L2 + 1, L3 - = 1 }; - int num_positions =3D sizeof(positions) / sizeof(positions[0]); + int num_positions =3D ARRAY_SIZE(positions); =20 hbitmap_test_init(data, L3, 0); buf_size =3D L2; @@ -880,7 +880,7 @@ static void test_hbitmap_serialize_zeroes(TestHBitmapDa= ta *data, int64_t next; uint64_t min_l1 =3D MAX(L1, 64); uint64_t positions[] =3D { 0, min_l1, L2, L3 - min_l1}; - int num_positions =3D sizeof(positions) / sizeof(positions[0]); + int num_positions =3D ARRAY_SIZE(positions); =20 hbitmap_test_init(data, L3, 0); =20 --=20 2.11.0