From nobody Mon Feb 9 22:38:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) client-ip=209.85.221.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602508830; cv=none; d=zohomail.com; s=zohoarc; b=Ehepk1yxyNGyF/aXn8Uv4XoUs6Gv/Tfr1P5zt8vXtDSGVKc+iNR/AKkWBXfNp2Om+2avI7hPyDPjX4u1pOqF1UN3ahqcRfT6AXw2a6vGKgkFkDBAb8hjBwKorjfVM1eWdtCZKFcWgweHkEXbYzKDdbcM4Ju81AgNLseZUfU8Hz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602508830; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JY3Ndr1SwLa4aQQZxdcgHQ230u1S4q1Vxx6foe4GpMc=; b=mrDbVMeM+OgkYlPD+ODC17DJcDhlHauvBQ5ztiDxOzHtrunAKGTBohRid0AnJTL54HdiJxlHm8XGEKONMOLP/3b8uRhXXqPot9+bvFzYDk9dQa64a7IDPLPwGYi7a+WIF4T/4KeCCO6q1T+ciEvA9rJVTaBXBpmiDUWIrbHKRk4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.zohomail.com with SMTPS id 1602508830595625.8286589809233; Mon, 12 Oct 2020 06:20:30 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id n6so18872850wrm.13 for ; Mon, 12 Oct 2020 06:20:30 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id e15sm24225544wro.13.2020.10.12.06.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 06:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JY3Ndr1SwLa4aQQZxdcgHQ230u1S4q1Vxx6foe4GpMc=; b=UfKIX9DP7TdbRCKdltMfWLSqZVcuaV9jEDALi64LrB2vd/AZCJfsT7/t0Alf+/abJ5 rSp+ZQ6HQcrSrHFUmJDVgvCBF+Zx/whxLcSZzcfcsmRob1bAPJEQsbGul99w/ixzwiF7 zs4EpoAIsfXRmDcFH3Mz2sly0fEtcALfoDQP8PGDg5AUHS9NLyP5YZxbzevn3N8gA+Qd hSGpRXcEfiF73Fsy3tojxiCQl7vRXSYSWx0Zpq243Mh1bBrCnw3icwhEIWaoB5e9otAv d0sVlOdp65XKgUfOVtQUeDZ6fD/RlzVddHZZXbq/AYqIqm2c2QMss+R+v3B+S27i5E50 y8+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JY3Ndr1SwLa4aQQZxdcgHQ230u1S4q1Vxx6foe4GpMc=; b=Yjiz/n1+IUtMoZr2zPzJwl+iJnPv+cVjeD6+CFAKlJ5tB1ma2AMFAHKpGlKkvi2L/u 9SxYSiuMua4JdHbmKNQydv10RcfKmW1UZ+5x5LWj+/C9Ef5b5DRcrdFy7ih+sRsJD+TR n5rxH/9UV6brAvtuiY2OmmWviFOql85jK4y//mZCQdGB19AssBeDzcfr3LoKDiLPiWmJ becKNeHJsf+VV6TO+KYd7Zru6jfW+Cu4Zn5dfSCb78WbszfP/qIu67/Wwucrayr1UEvr JSDqm+GWoRI0kTOED+phzhM4yYqo1XPxiGbnJnG3mj3gAtqboFc7emWi4/FENcHTEi8K B4AQ== X-Gm-Message-State: AOAM531oL3P4yv0AmNJpWRWCAi2SIwlPhep3rS+tjT0TBVmVwKKgsDbW 405bAI6IUXylXqdjbIEQL5M= X-Google-Smtp-Source: ABdhPJxlJ5+SmRXQ6NUT6GWhDLb5a/5Azd/dn/M6f+cZh+THr/rzhNpfvScN2c9HMTr3Xl141DrgFA== X-Received: by 2002:adf:f10e:: with SMTP id r14mr28581151wro.337.1602508828801; Mon, 12 Oct 2020 06:20:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Peter Maydell , qemu-arm@nongnu.org, Aurelien Jarno , Aleksandar Markovic , Paolo Bonzini , Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/5] hw/pci-host/pam: Use ARRAY_SIZE() instead of magic value Date: Mon, 12 Oct 2020 15:20:13 +0200 Message-Id: <20201012132017.3423954-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012132017.3423954-1-f4bug@amsat.org> References: <20201012132017.3423954-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Replace the magic '4' by ARRAY_SIZE(mem->alias) which is more explicit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/pam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/pam.c b/hw/pci-host/pam.c index a4962057833..4712260025a 100644 --- a/hw/pci-host/pam.c +++ b/hw/pci-host/pam.c @@ -51,7 +51,7 @@ void init_pam(DeviceState *dev, MemoryRegion *ram_memory, start, size); =20 memory_region_transaction_begin(); - for (i =3D 0; i < 4; ++i) { + for (i =3D 0; i < ARRAY_SIZE(mem->alias); ++i) { memory_region_set_enabled(&mem->alias[i], false); memory_region_add_subregion_overlap(system_memory, start, &mem->alias[i], 1); --=20 2.26.2