From patchwork Fri Dec 6 19:11:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 847858 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp952877wrt; Fri, 6 Dec 2024 11:13:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWyXA/STHwLwVp/H/gDPIp3EZmDDyg6epH9a1kJptXQGHM+8rH5j1JJu2q9G278stxiOsI3pA==@linaro.org X-Google-Smtp-Source: AGHT+IHmnFimYTP3gXdAYz3r6pNoLPfnlHVlfoJIZf9C023BQPf/0wFqXgpV0LUkHCeQsdTX4Lic X-Received: by 2002:a05:6214:2028:b0:6d8:8f14:2f5c with SMTP id 6a1803df08f44-6d8e717de65mr87018396d6.23.1733512389272; Fri, 06 Dec 2024 11:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733512389; cv=none; d=google.com; s=arc-20240605; b=Mw52wFFUOR8D2ILX5tyewDejZEl4+XtJ7nZnaUUVJ662h2Md2ggpHCZh7cdQGiiZAS UiC+a9vHZj+WEQkT40JWk/u2Exdiv3S+O7litwxqYBhnNjLFvFKzKTQS4BnfBZ3Ckv+g TWNeN54L22TaeJZQpqRT1Up4IXjGYZOxIG0SJNKVV2URy5EB2NP7L5dtsuZ5bLt4lRgL k+kmlXB7JM/+QG4Jyz/nkKL9qlAOQQxNH/qQaqrHjA+c3YkOaLW7/g1JzQj3BswAQyuv 7u7YsL8q+SLCcxDcC/J080Xcpqud2WnUOUI4fTuNLNXxzCETJOqEl71USevyODD26DE4 gVFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=inpxKK/bSOw7wpkiYaFHlIXdNffEZkImnMWDkwESKJk=; fh=nor25M+9+H107JlZXKJGdGrH0Gd1Bpyuyq5I9vqTo+I=; b=Jjv5KWgrbWo4UueYUGHa0uhpyVfgEGX1LqDEef3s2L9H9K8a+TDmGSYsiMRQotm7K6 znYuNbOya4VF1weCBhF9P2LcBt+oWvje7milisYi51Qrt+Cyz4p6XKPy/IAhnfQDFX19 LjVk8XXxEMES4Eehw4trFoMgw/LJbxohqvDO1PGz+67LdAtR2Jt52SxhqqMadBnMq7pU T0ih5dj3aeMg7nNqK6xngE/Oomfc89dshfhVoF/9l15NGsN35XjqYmC5cTSkL+gQbCy9 n6Jxy1ckihzcxbq1I/9A2r+YoMeAeWY9xz3jVlpAipqys54y69pMSlBv9ZTQ0Aj7nNcJ xs2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwemHclZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b6b5a4844asi454677785a.96.2024.12.06.11.13.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Dec 2024 11:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OwemHclZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJdjy-0005vD-1Q; Fri, 06 Dec 2024 14:11:50 -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 1tJdjv-0005ut-7P for qemu-devel@nongnu.org; Fri, 06 Dec 2024 14:11:47 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJdjt-0001ea-M9 for qemu-devel@nongnu.org; Fri, 06 Dec 2024 14:11:46 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434aafd68e9so17027245e9.0 for ; Fri, 06 Dec 2024 11:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733512304; x=1734117104; 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=inpxKK/bSOw7wpkiYaFHlIXdNffEZkImnMWDkwESKJk=; b=OwemHclZSo9xwe1p0E0SEKFPyoaMRjsFhrQkJmkPDK+rhR0m/0Jfhws960RfCd8pnx /u7M3/JOhg0Q6z0tzigyRpXzdXi9BWZXgdKIT951YiPnSMgsUnin36QoisOd1IMwCXlA BXqs9U1kE/b7K/XTez4YQkn2zyG5tkzTot85W4Hf+yrHY6VDABD+oT1y61aRwId+egjL BELriPNNFei7cCvWSdNFfFp7uPbVgY/8WsJ0g4gxECXokFJrfOKT7CfoFIMpual6aDsU C0oF2jOvW00f7p7ebRkclZr5RnVZc/7lCJyhckeTbrffHnTwzXUlmwpSgFV5UafmMdKb /X7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733512304; x=1734117104; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=inpxKK/bSOw7wpkiYaFHlIXdNffEZkImnMWDkwESKJk=; b=ZpzaH2OcQZ2OKlcZIACMlyylbjOp/jcFTBflP4G2VjKrfrHHJTOj62OIZT8/W5x9Ed BmyaELyfyaEQNj/pY77zCeoN50S6x38w4p5Ay/vvhol+eAy6GTnRH8Xl9oeshveTFpb+ mUs4+glzPbtJzqO/yTzvKzfWCurO4GydDGA0CLkneGJJEKL+SDuZrNjq9ZR1SX5dGuy/ wg19iW2tsEbnOeJ/Z6cE5ohueskqTXSS680zKCoF++rpI72XaFAXSupG6akb0kczl9No T3fivP/hffQcYV0pPgo/hv6BTB+DnJQzWV+bfftEUrnTrAR+yUtbo0ReNHlKA7KPlMi/ cUTQ== X-Gm-Message-State: AOJu0Yz2aZqzMXxAzjtw4giDC7B2EsAG/ABBerPlOpqD+qXY/kJnYHi+ 11eXN8gJnRyAKJuVlb7/U6rueWNaSLQc0KOVhvkpEmQObTnVLXoieMeXFvO82nIwmYhx2OOmGml HfbY= X-Gm-Gg: ASbGncuoZW+hyDkgce7NJV+Jwg99An7AWoYUKzQP9HXBbQTQbdCEobpTYlxao+WNrFm su+YNavz0rmDrU94yM4XE2qL6eKDJW1Mg1YOHdfC10BpMSJAwoh3RYy3TMGr7VLeX4yg0T58ORv KiztGOIaiYmopCoATq0kyFSLKJ80zz9Yk+GTjl5/+6roIuiwrqI6WNtG0H0ZjylPWtzu101fSZl E7IIodEes343OXXev//sK6SC2CiXBHYOrRtulj5nEiyRkoCVAo5k0fY80wvw6Ko9Mc= X-Received: by 2002:a05:600c:4eca:b0:431:6060:8b16 with SMTP id 5b1f17b1804b1-434ddedbb3bmr43086355e9.30.1733512303951; Fri, 06 Dec 2024 11:11:43 -0800 (PST) Received: from localhost.localdomain ([95.127.41.180]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526b312sm104463915e9.6.2024.12.06.11.11.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Dec 2024 11:11:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Zhao Liu , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/4] hw/timer/hpet: Reduce hpet_cfg[] scope Date: Fri, 6 Dec 2024 20:11:22 +0100 Message-ID: <20241206191124.9195-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241206191124.9195-1-philmd@linaro.org> References: <20241206191124.9195-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now than hpet_cfg[] is only accessed within hpet.c, make it static. No need to expose the hpet_fw_entry/hpet_fw_config structure declarations outside of it, so move them in the source too. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/timer/hpet.h | 16 ---------------- hw/timer/hpet.c | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h index d361ab9e931..2a95799a679 100644 --- a/include/hw/timer/hpet.h +++ b/include/hw/timer/hpet.h @@ -60,22 +60,6 @@ #define HPET_TN_INT_ROUTE_CAP_SHIFT 32 #define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U -struct hpet_fw_entry -{ - uint32_t event_timer_block_id; - uint64_t address; - uint16_t min_tick; - uint8_t page_prot; -} QEMU_PACKED; - -struct hpet_fw_config -{ - uint8_t count; - struct hpet_fw_entry hpet[8]; -} QEMU_PACKED; - -extern struct hpet_fw_config hpet_cfg; - #define TYPE_HPET "hpet" #define HPET_INTCAP "hpet-intcap" diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 9ca1424565f..849cb3e669b 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -41,6 +41,20 @@ #include "qom/object.h" #include "trace.h" +struct hpet_fw_entry +{ + uint32_t event_timer_block_id; + uint64_t address; + uint16_t min_tick; + uint8_t page_prot; +} QEMU_PACKED; + +struct hpet_fw_config +{ + uint8_t count; + struct hpet_fw_entry hpet[8]; +} QEMU_PACKED; + #define HPET_MSI_SUPPORT 0 OBJECT_DECLARE_SIMPLE_TYPE(HPETState, HPET) @@ -87,7 +101,7 @@ struct HPETState { uint8_t hpet_id; /* instance id */ }; -struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; +static struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; static uint32_t hpet_in_legacy_mode(HPETState *s) {