From nobody Tue Feb 10 06:07:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) client-ip=209.85.221.66; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f66.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1602445772; cv=none; d=zohomail.com; s=zohoarc; b=SWMR49LxiwOBRi3JZIzGETIGSJ6IbI9JzQxCq1hcHhG7A6C5z8v/ho3O5b58jBk70OkWuQWMLhFDK/SWElTPf6vJETFmtemf6NdSsj/2UtHowh05EoNQZM4oTfU9vxoD3u4m7t3AAHJvnFKm7U68czeOuL+DHvBk2SMF48VA7zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602445772; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JY3Ndr1SwLa4aQQZxdcgHQ230u1S4q1Vxx6foe4GpMc=; b=SchKOColIm/qE+3dhn6X8wgFNVVwkHB1rRzYzQTgCusCZFnFr3xh4s7GbA21yjKosopzU6io/e5oX6DVdPaqFh66qTT0YfBfJb6ZvgYUk7HEAP8aNt/xvtG+DKxgAcS2FnFRMwvRjYcK3KDjsqw02V6ueTo1TdRQ7LMjbpO2zDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.zohomail.com with SMTPS id 1602445772313906.2900298820884; Sun, 11 Oct 2020 12:49:32 -0700 (PDT) Received: by mail-wr1-f66.google.com with SMTP id t9so16595011wrq.11 for ; Sun, 11 Oct 2020 12:49:31 -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 i33sm23103929wri.79.2020.10.11.12.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:49:29 -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=b5U728+2oqLyxZLK4gVj4hJFF5c7HoW2X5d0QI2a87MHPnJgyvbKCwWg8T53YDnYO7 KjIgq/5JFyG0MP5wq7hPVoPsYn4moSSjhsha7EpKdldGOrhmmhvL2uzFc8buzf9qGKRI GjDSJCoiqrYM/+ChzcaJeyQ5965bSm8S0KR2iOM+1FbiKTntdQoOd4CrBxdzo/wuuSFs Qvx1VW69GKaxcgxgM1RmZNd6E51sagjsNXFhE+vLpEyn6VnPSZwmjClikToWDlsnR5Rj kIIuk65udgF1FRQzqHUR4nEJ0lgbU/ANVyeLdDkYfKv/xKdeSiY1zHgNeilymXP25Kt1 lWSw== 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=lkuCx4vR3ed00SwABrjTqATlB8POFict95xHhrvsRHnE1FwC7O43r8CNbccnHEQ/k/ j3lpH42HZdyltdkn0gQsZnFfpLeod1N/LScPyzvrJQoyj2qs2Y4Y60Rnq4Nz+e268bW+ Vh7YDSc4LPhJFUVmCz/pnjtUTfazakEWACmp6G9f7fjHuYr5dnVMXQVff0uVbq6jcqUv XOT9cmkBd+TGMd/b4/X/o6uX+qMgt9W0PVwLA6LkwxD3xcJLdjF4lWZbSd74wz6l0xJi yJvRBQq3V0eg3zo6Q1cwL0XIMj/7HtlGV+CAY3DBk0W7w4xlSd/hezKh3sQtZvvoZ9B2 BQZg== X-Gm-Message-State: AOAM530Mhf2DVaZwjiTL+l5r7y+gETPfHEi2+QpPP9Q5bK6AHiP8VguI OTn0WgO7TK8fgSS57MMfXv8= X-Google-Smtp-Source: ABdhPJxhe4c/Rrv2QOxu3KWA6WEA0ZbB+4sMM43H46rAAHhqNpE96oGJiyinUINbzNT8ZV8E1p7JSw== X-Received: by 2002:a5d:4282:: with SMTP id k2mr24940583wrq.270.1602445770381; Sun, 11 Oct 2020 12:49:30 -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: "Michael S. Tsirkin" , Aleksandar Rikalo , Peter Maydell , Aurelien Jarno , Jiaxun Yang , Paolo Bonzini , Thomas Huth , Marcel Apfelbaum , Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Laurent Vivier , qemu-trivial@nongnu.org Subject: [PATCH 2/4] hw/pci-host/pam: Use ARRAY_SIZE() instead of magic value Date: Sun, 11 Oct 2020 21:49:16 +0200 Message-Id: <20201011194918.3219195-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011194918.3219195-1-f4bug@amsat.org> References: <20201011194918.3219195-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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