From patchwork Mon Jan 9 14:03:05 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: 640662 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2205991pvb; Mon, 9 Jan 2023 07:33:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNubJ004CYzc/appRjrZbh333VcXHKI9c5fv2ExqbZYj8j/bgBzmBZjvpsHefpXx0qIkgT X-Received: by 2002:a05:6214:3244:b0:532:2eb3:803e with SMTP id mt4-20020a056214324400b005322eb3803emr5314439qvb.8.1673278393017; Mon, 09 Jan 2023 07:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673278392; cv=none; d=google.com; s=arc-20160816; b=AT3F8oqZimHJFh3tAK0E8tutUc6TpnoHQKZaTZmxuZFD3I3LCdqzGiC2YKpf9KyWIU OSxM5TDoKcCoUoFWDwxv4WLax85lFdbjX5WUnpE07x+AjE8rMb3zOICjFxlwlL8InO9z lEkse1husAWAcwhPTxoMFu5iTACh29mqS3J5unjTFvRnxozi7kD9OOhIoUtHluvJnN4l ev0pNswD0CJ+DeZWKwqvJLKjWu9HfgvcPAj9AQi3S1OUEvZH7GlSZ7kSAtLbNZnpERPy Jz+7mui2l3Ey2/3GLNNe6B6ZrEJEGiZWbNOk3wUuK7MEVfX5H72d96rp8H2AeW33w0dz VS2g== 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=2gvdf7MKgAqOkpgoECI87U6UIVZrGkUaGXJayKsJqzE=; b=itV2jaDyv3TwkIf1moqB6IC5mTnhZNnCK1Ox7yPZFHqNvZ9ShiRqNyQkEFW3/W38F8 fSA+c2k8GzqTYlkbjyoHsu6EuJkxJjLb9IVVwLWcb0eUPM/YF0eftb186H6iXGI9VX70 6TJC5QgFXUvA8dFGpPCiO/qbfAsJa0HX1EO5ZbdZuVROQ6BG3fM/E8NP83wKYR0K/bca TfD5B5lAUgA00mmjY3rCFbpD4nulbEp0wbfOmCbK12q1LeMUXNNbAeW3D1kR+HuA5VHo Dv1CP/B/aneC/hQs7xGDLnc6aI8+0lBFrKVPHkEy5Eqm/5zn/Z5WgtyEc5urcnnKPUT9 CEkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xvoG6pZO; 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 iy5-20020a0562140f6500b004bb69267be7si4708401qvb.531.2023.01.09.07.33.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 07:33:12 -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=xvoG6pZO; 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-0001zW-Q9; 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 1pEslA-0001sB-Tf for qemu-devel@nongnu.org; Mon, 09 Jan 2023 09:04:22 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEsl4-00075e-67 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 09:04:19 -0500 Received: by mail-wm1-x32c.google.com with SMTP id ay40so6346304wmb.2 for ; Mon, 09 Jan 2023 06:04:13 -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=2gvdf7MKgAqOkpgoECI87U6UIVZrGkUaGXJayKsJqzE=; b=xvoG6pZO1tl/N0GOiWKJDNz4VIn0BW/rIN6xl/jJwGwJPmX4hkRbbG1FojLhjg4ziQ WA0JWvl3Bcwp8gctRtDvitDN4B+WQVPGMTC+lgEqpVU/yn6CSJ/hUGf4qdES22U5UdNF Pgcuy+9VtHs5v5l2PooPedXvagnOXcBw8eyPPrtUmYCvBs6hdSY5XrjjeKrBUHnpPPhG A6Fzif7Xk64vwrjbq9WXgsLjPpcv/uwtEXhGMlVBAU8cv+OAQDJWUO3f/xvWDTEWYG0I grgVeMu6IZosom+gC0uDJ5N1RMulZku2SZNlBkfhrJEIoYnxwnbrFOJKxVHdHnaT+9FZ mDKg== 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=2gvdf7MKgAqOkpgoECI87U6UIVZrGkUaGXJayKsJqzE=; b=SZ1d/bw6wK0PPqoKyEz+PPof940X2892dEJBk6T5iRQmOSynxalVg+/rK7hb+fVMJB 2OLqb/20YC7tydjEGSpzwZzZNEzDDipHtjTmzdnfEwVecs9MXqbKGmyDXOgouAOOjI+3 FtxlNnY66KAnDPd+UwR/UXl9c9tPcb1MyrQmed97HusD6Iolr6/eBDfR6LGgjE2/dLuL no/JoNL2dXXBS/Fvw2bRb569GNnLQ1G2fjSO6LwFtRCucTHmE9ZljL/JH0Tk3UtQFJBj xvElbq+7EnRokG52htCvrPqEbkAcqjvTtC+A6FSxCikGnGERBcmB0slZF6CeuJJM4Qrx t4DA== X-Gm-Message-State: AFqh2koGR0oV5viu6If/ZP5dhPQMp2EB35FgxGcNL2/na87oHOhGtFm9 J7pKupHPZrnaXKpeF2Iij/nDRKixOgQLlVHx X-Received: by 2002:a05:600c:539a:b0:3d9:efe8:a424 with SMTP id hg26-20020a05600c539a00b003d9efe8a424mr2516127wmb.34.1673273053181; Mon, 09 Jan 2023 06:04:13 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id fc14-20020a05600c524e00b003a3442f1229sm18134541wmb.29.2023.01.09.06.04.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 06:04:12 -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 13/14] hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic' Date: Mon, 9 Jan 2023 15:03:05 +0100 Message-Id: <20230109140306.23161-14-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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/intc/xilinx_intc.c:45:1: error: declaration of anonymous struct must be a definition DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- hw/intc/xilinx_intc.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 4c4397b3d2..6e5012e66e 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -42,10 +42,10 @@ #define R_MAX 8 #define TYPE_XILINX_INTC "xlnx.xps-intc" -DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, - TYPE_XILINX_INTC) +typedef struct XpsIntc XpsIntc; +DECLARE_INSTANCE_CHECKER(XpsIntc, XILINX_INTC, TYPE_XILINX_INTC) -struct xlx_pic +struct XpsIntc { SysBusDevice parent_obj; @@ -62,7 +62,7 @@ struct xlx_pic uint32_t irq_pin_state; }; -static void update_irq(struct xlx_pic *p) +static void update_irq(XpsIntc *p) { uint32_t i; @@ -87,10 +87,9 @@ static void update_irq(struct xlx_pic *p) qemu_set_irq(p->parent_irq, (p->regs[R_MER] & 1) && p->regs[R_IPR]); } -static uint64_t -pic_read(void *opaque, hwaddr addr, unsigned int size) +static uint64_t pic_read(void *opaque, hwaddr addr, unsigned int size) { - struct xlx_pic *p = opaque; + XpsIntc *p = opaque; uint32_t r = 0; addr >>= 2; @@ -106,11 +105,10 @@ pic_read(void *opaque, hwaddr addr, unsigned int size) return r; } -static void -pic_write(void *opaque, hwaddr addr, - uint64_t val64, unsigned int size) +static void pic_write(void *opaque, hwaddr addr, + uint64_t val64, unsigned int size) { - struct xlx_pic *p = opaque; + XpsIntc *p = opaque; uint32_t value = val64; addr >>= 2; @@ -154,7 +152,7 @@ static const MemoryRegionOps pic_ops = { static void irq_handler(void *opaque, int irq, int level) { - struct xlx_pic *p = opaque; + XpsIntc *p = opaque; /* edge triggered interrupt */ if (p->c_kind_of_intr & (1 << irq) && p->regs[R_MER] & 2) { @@ -168,7 +166,7 @@ static void irq_handler(void *opaque, int irq, int level) static void xilinx_intc_init(Object *obj) { - struct xlx_pic *p = XILINX_INTC(obj); + XpsIntc *p = XILINX_INTC(obj); qdev_init_gpio_in(DEVICE(obj), irq_handler, 32); sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq); @@ -179,7 +177,7 @@ static void xilinx_intc_init(Object *obj) } static Property xilinx_intc_properties[] = { - DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0), + DEFINE_PROP_UINT32("kind-of-intr", XpsIntc, c_kind_of_intr, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -193,7 +191,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data) static const TypeInfo xilinx_intc_info = { .name = TYPE_XILINX_INTC, .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(struct xlx_pic), + .instance_size = sizeof(XpsIntc), .instance_init = xilinx_intc_init, .class_init = xilinx_intc_class_init, };