From patchwork Mon Jan 9 14:03:06 2023 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: 640661 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2205404pvb; Mon, 9 Jan 2023 07:32:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXso/9D0DeAoyYmjzgyGv/NQLtZHXY0ONDsvZkDzvymwGWu2PDe/b/Fylf3eIL/6VY+kw6bi X-Received: by 2002:a05:6102:fa9:b0:3c4:8a20:60fd with SMTP id e41-20020a0561020fa900b003c48a2060fdmr32911785vsv.24.1673278331982; Mon, 09 Jan 2023 07:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673278331; cv=none; d=google.com; s=arc-20160816; b=QynfCk4Mj3Ji03EFfRwkjGLVM9hnss+sEhsfeaWmarIAnllFoyd1xB7GfDCxcrqimL ZBi/0r+9++pb+l0vkqxTfoDWrqduoZWZrvkPOR20hymxKKqMsRrb04R9KYb/LNA5bLm6 oK6lLWwOUBzuROcjFiw+yn4aoMR4IE3SwDQa0u02rDfZx4s6uneYu3qytSrk5JkLpURx wjnuKrHT4PEgPRoAzakzs42o3QXttGh3SduqkmeFAQJcQTb9e8rlGP/U68WUpIeyiVzs 3nM1GASps33oVNCytuzF/t/51kjR8+E2jkjnv9po4maPyZLW5yd6jfhhfFXHbz+bN8DZ PVgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=WrR1GDMObTllDPwJtD3Of+jW/9BkqqN5WyyEeN1uJKY=; b=gjQjcyXMeSCq8hCV3SOF+BGLxN4lmoAtKqoALg0n8zjHGq44KKDN4MzcLx0lmrEUyV 1f6I/0p7yb7akfAV45FIDgUaVtyJFYAs3XpglW7dk2r5YXUL+WAMa+Yy4jtzOxYVZd93 KMFNpTZHLVH2bb/v7PB/6VzYGnR7llPk/n8QTkaJGcL7d8kv43jYE5amQJBqH1rFyLmU oNnn9N+uKSzbLRcgh8XZI9WBITYXUDBIEOR1VmyeBnmgrU56mjZ9VckMxdbhJoJMaJ+e gCyv5HZIJKoH5XoyI5LTEaSUNMxbq7ahgC1zVvBot9x/6t4QZKCClkyzIEcPn1jXcxCC DMLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iOZ+uxN5; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q19-20020a67d793000000b003c5b75abd5dsi2087613vsj.568.2023.01.09.07.32.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 07:32:11 -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=iOZ+uxN5; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEslR-0001zC-01; Mon, 09 Jan 2023 09:04:37 -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 1pEslE-0001tE-0j for qemu-devel@nongnu.org; Mon, 09 Jan 2023 09:04:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEslA-0007Fv-MP for qemu-devel@nongnu.org; Mon, 09 Jan 2023 09:04:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso6859934wmq.1 for ; Mon, 09 Jan 2023 06:04:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=WrR1GDMObTllDPwJtD3Of+jW/9BkqqN5WyyEeN1uJKY=; b=iOZ+uxN5jCKG7I/DUWcF6QaCuPpV14kq9LNDH7pB/h2nPr8ZNwh5h9M9a2USyhvQiI q+nGXUiUKan1D7a/RatyCvAlAPp4zH8fuhUt3g9R1vVGC+cWCIIG363Ja6YFd9fzBzgJ xJJN3Ef5A6K45/R79amUCbOkD4wlWUrFd/tjz2+iLAkdxccpNsHWVjL1oWCH/b1WaYxH 6ZCYlxq6bftJvSO8TV5fCnVMRczNcueSoZM+MauthPn5d7siI0Fe+grXiXf9bfrUEW9J wsXvi8NsTdpPyTrGOYhdp/HqBXtyD05EycNT6gX+lITCzXC4ejnLUSOhciazLYEbvqNo iKEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WrR1GDMObTllDPwJtD3Of+jW/9BkqqN5WyyEeN1uJKY=; b=Hz/Sq8OPQ4ZS/cSGOF09iHiFBHc36YWurGK38odrzhj0Ga2oPdcxeM8/9ikn1L/TZU QIcPZhtVCMdZHhllh/Wy74Ax2s2xY2WVqpHIY4oHW5Tdxm8Obs1egkhoUBMnn6191vfE xduqYkzJfyM9F0Z2nXWyjw3drTjNEA3UAfbnIhIBRDsEIcYoyiW/pqkd7/3nZcJGW/iF q+SFrVO6bNCyDtz2TiCHNGv0WXeI1AeTcz9JW58ATWxCjFnDHgMmsieLiFZpiuPsasRd tYqbNAZAss4lLpXdzuMLsMPedbXNu0ZPEro0nZAT7Uv6xBSDPQq1JrEP3qTnjAYjwr78 dWdQ== X-Gm-Message-State: AFqh2ko1tV8oLlm/6Qj/XJKc/mMTqgi2tJZg2XaEVvm2ktfRiMURPI3P WCTXcRC1C5iyfNgXQykzIQkYLHZ9qbPP5F4A X-Received: by 2002:a05:600c:348b:b0:3d2:2a72:2577 with SMTP id a11-20020a05600c348b00b003d22a722577mr45551835wmq.27.1673273058111; Mon, 09 Jan 2023 06:04:18 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c339300b003cff309807esm15064539wmp.23.2023.01.09.06.04.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 06:04:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Havard Skinnemoen , "Edgar E. Iglesias" , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Eduardo Habkost , Tyrone Ting Subject: [PATCH 14/14] hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock' Date: Mon, 9 Jan 2023 15:03:06 +0100 Message-Id: <20230109140306.23161-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109140306.23161-1-philmd@linaro.org> References: <20230109140306.23161-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call, to avoid after a QOM refactor: hw/timer/xilinx_timer.c:65:1: error: declaration of anonymous struct must be a definition DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- hw/timer/xilinx_timer.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index c7f17cd646..32a9df69e0 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -62,10 +62,10 @@ struct xlx_timer }; #define TYPE_XILINX_TIMER "xlnx.xps-timer" -DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, - TYPE_XILINX_TIMER) +typedef struct XpsTimerState XpsTimerState; +DECLARE_INSTANCE_CHECKER(XpsTimerState, XILINX_TIMER, TYPE_XILINX_TIMER) -struct timerblock +struct XpsTimerState { SysBusDevice parent_obj; @@ -76,7 +76,7 @@ struct timerblock struct xlx_timer *timers; }; -static inline unsigned int num_timers(struct timerblock *t) +static inline unsigned int num_timers(XpsTimerState *t) { return 2 - t->one_timer_only; } @@ -87,7 +87,7 @@ static inline unsigned int timer_from_addr(hwaddr addr) return addr >> 2; } -static void timer_update_irq(struct timerblock *t) +static void timer_update_irq(XpsTimerState *t) { unsigned int i, irq = 0; uint32_t csr; @@ -104,7 +104,7 @@ static void timer_update_irq(struct timerblock *t) static uint64_t timer_read(void *opaque, hwaddr addr, unsigned int size) { - struct timerblock *t = opaque; + XpsTimerState *t = opaque; struct xlx_timer *xt; uint32_t r = 0; unsigned int timer; @@ -155,7 +155,7 @@ static void timer_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { - struct timerblock *t = opaque; + XpsTimerState *t = opaque; struct xlx_timer *xt; unsigned int timer; uint32_t value = val64; @@ -202,7 +202,7 @@ static const MemoryRegionOps timer_ops = { static void timer_hit(void *opaque) { struct xlx_timer *xt = opaque; - struct timerblock *t = xt->parent; + XpsTimerState *t = xt->parent; D(fprintf(stderr, "%s %d\n", __func__, xt->nr)); xt->regs[R_TCSR] |= TCSR_TINT; @@ -213,7 +213,7 @@ static void timer_hit(void *opaque) static void xilinx_timer_realize(DeviceState *dev, Error **errp) { - struct timerblock *t = XILINX_TIMER(dev); + XpsTimerState *t = XILINX_TIMER(dev); unsigned int i; /* Init all the ptimers. */ @@ -236,16 +236,15 @@ static void xilinx_timer_realize(DeviceState *dev, Error **errp) static void xilinx_timer_init(Object *obj) { - struct timerblock *t = XILINX_TIMER(obj); + XpsTimerState *t = XILINX_TIMER(obj); /* All timers share a single irq line. */ sysbus_init_irq(SYS_BUS_DEVICE(obj), &t->irq); } static Property xilinx_timer_properties[] = { - DEFINE_PROP_UINT32("clock-frequency", struct timerblock, freq_hz, - 62 * 1000000), - DEFINE_PROP_UINT8("one-timer-only", struct timerblock, one_timer_only, 0), + DEFINE_PROP_UINT32("clock-frequency", XpsTimerState, freq_hz, 62 * 1000000), + DEFINE_PROP_UINT8("one-timer-only", XpsTimerState, one_timer_only, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -260,7 +259,7 @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data) static const TypeInfo xilinx_timer_info = { .name = TYPE_XILINX_TIMER, .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(struct timerblock), + .instance_size = sizeof(XpsTimerState), .instance_init = xilinx_timer_init, .class_init = xilinx_timer_class_init, };