From nobody Tue Feb 10 04:17:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1766082003; cv=none; d=zohomail.com; s=zohoarc; b=U53j++f8Z0h1IF18V7AD5MfJg2FVPhT5G4EW/ajyxThUL7jAskHJYRkoYRKg+XUY5mYzhg+azwcx5jaqQDSoxj2jwnsSounGmx7yOJ80egzjdMis+bIciIPhNOSa2uBS0JbmqM/sgFGFMS2QqZ5Zms9BS1GYGoxRbx0YRIMP2R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766082003; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Fw9wiW8eGiYc4imf57ZBrS/UxIVjWCdGG1Tt5+MH7Y=; b=hSbJ+0pLX/7Bhb5I4p/EWSlg+r2f2KFFiBlhdpI3/KxixODphzjUhPGhkMtNpyFfa7pekyezWxmJcNxXwdQMMYotfd6tE5G2zdNPT/CmUrRNLULWQTyJmbT9HKvETg2nkxltKg32GGvFCbpk7rg7BLnFb6lqRPfb9XJBBR0+2k4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1766082003150841.6085537880092; Thu, 18 Dec 2025 10:20:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vWIas-0006TV-6N; Thu, 18 Dec 2025 13:19:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vWIaB-0006O7-AF for qemu-devel@nongnu.org; Thu, 18 Dec 2025 13:18:40 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vWIa3-0002yq-Fa for qemu-devel@nongnu.org; Thu, 18 Dec 2025 13:18:31 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4777771ed1aso7612135e9.2 for ; Thu, 18 Dec 2025 10:18:23 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d19346e48sm3223475e9.2.2025.12.18.10.18.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Dec 2025 10:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766081902; x=1766686702; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Fw9wiW8eGiYc4imf57ZBrS/UxIVjWCdGG1Tt5+MH7Y=; b=DK4sxOgFDcz0j3Ug6SMlaqCbOj6OJjQS4BHT7yvspOJnxB4DSQ7mEAyEX61MoBQcxN /ml++01sZJ+Qvd9SIAE48XpRtRZq2uz++3trcx1lxcbUc/XrfKprAn9L64uyg/vgODHb NtJD4isRJ46IcfSnXDJDU7bFDtzTwIS/dmZIUHHggQNa4BU7bhoEgYKqoMmOnib0PlaE O+qnSnGXUBEBbLa258kaos5GyHTlIcQrFrYbnUmbRA4HKJGfxRbioaF4vI6BhkVhNCqM ZBvTlpZ1goD7HSFv5zGFnfngUppA8r66fQeWhKFdHC2mceeKKpRCyc9W1lePyBVUO96Y 5cmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766081902; x=1766686702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8Fw9wiW8eGiYc4imf57ZBrS/UxIVjWCdGG1Tt5+MH7Y=; b=UjVhp8vWffU36lEXhdiQNWlG5KiYg0/L9aCZimkxdAYTNoLO773hu+eHMTInUYgicf V4bAPVpfT8s/S+ylMMWmeX/BCODu0y6j4/fpeDjR6K4S/F1BNnwTB5B9TtZV88GExenB Da87bFyTWzl3gHGzbc+vIg/nRdMepo3VetUTu4LX7clzeNutRdJZkwuYQm1+Xr0ZnMpH gi13GKB9YxNd8UNOQBU7OEdgTX03nRA9njyzkUB36UTekGV217at6/wEl1o1EoCrabGp EM6ttf+oLp2PdutR79OWsgTJhTvMVDtwQywvMi/Y133dua/g2pBM5M0hTtSVftMd4NhM ZJ1Q== X-Gm-Message-State: AOJu0YyPYaq++/vVpvgEony2XCb7+xNwRVxDYaiWypuWQ4UJtDqJw1z3 bfuC757tjsJU66G4OuZNJM/7hvz8s/F3nnrsG4yEpEo/+UA7nfEbLbPNN9FMvoSCXZJakflq53c w5ZyuxnU= X-Gm-Gg: AY/fxX5m4WGVN2HBDwK31wW0vjBp3WVSyTFKaB9+fvjeqQjJufA/4BwdOnfG/6BozlM uBYNvnA1+ToVG3gseRJXtqtkmY8kvsFfOToaD5BQwyxTShjzLgLufvjOvUbIjGHY8M3lTzTbkd6 5OD3tz+CDu5AygPcUAr00VoCX5GDY1oS77ILv/eqY4WuDkfvdtOeyqNm99MxLkYnLwQ4NU5RbYT YrBn6isO4JsvxO9RaaHyN7OiUtXv6MTm+zNIN1HouxABogUP1uZwt/gPkLeoaljNicXox1qKQRa mKmEK95AU7VccAj8vla7ExofYNbDxo9Aj/pLRNbMCFGdC7BH8iovjUgxC44CS54f//gxHB/uNw4 bEPDJjoeNMV9ozNpYCknbDtt/qB2kuE+RvCvmy2PI+RVPofIF3lj5/vehN5YYvlvjHLCjv+aVlV rhV+Aw8Ll2uT+NBNQUZ5MN1lSgCod6xcs6zc3m7UWW8MmuxNTdXNcA+a7KusdPO6Zz4iW9dIs= X-Google-Smtp-Source: AGHT+IHqA+vzL5VfowrzPMh4sMwFeuxieIhnO+m2qRQLOkWuGZXOGkqq7f16yyX5dRTnLIeRTkV5vg== X-Received: by 2002:a05:600c:4e8f:b0:477:df7:b020 with SMTP id 5b1f17b1804b1-47d1957da79mr976125e9.18.1766081901671; Thu, 18 Dec 2025 10:18:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Maydell , Jason Wang , "Michael S. Tsirkin" , Max Filippov , qemu-arm@nongnu.org, Manos Pitsidianakis , qemu-rust@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/6] hw/char/serial: Let compiler pick serial_mm_ops[] array length Date: Thu, 18 Dec 2025 19:18:06 +0100 Message-ID: <20251218181812.58363-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251218181812.58363-1-philmd@linaro.org> References: <20251218181812.58363-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1766082005250158500 No need to enforce the MemoryRegionOps array length. We index by device_endian enum, the compiler will easily pick the correct length. Besides, this allow further adjustments in the device_endian enum itself. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/char/serial-mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/serial-mm.c b/hw/char/serial-mm.c index 13aba780ec5..ce5b589c3fd 100644 --- a/hw/char/serial-mm.c +++ b/hw/char/serial-mm.c @@ -44,7 +44,7 @@ static void serial_mm_write(void *opaque, hwaddr addr, serial_io_ops.write(&s->serial, addr >> s->regshift, value, 1); } =20 -static const MemoryRegionOps serial_mm_ops[3] =3D { +static const MemoryRegionOps serial_mm_ops[] =3D { [DEVICE_NATIVE_ENDIAN] =3D { .read =3D serial_mm_read, .write =3D serial_mm_write, --=20 2.52.0