From patchwork Fri Jan 13 20:01:36 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: 1726379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Cn2mKzV6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ntsmy0ZFJz23fk for ; Sat, 14 Jan 2023 07:03:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGQFZ-0003dC-Gl; Fri, 13 Jan 2023 15:02:05 -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 1pGQFQ-0003YS-E3 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 15:01:56 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGQFO-0006mc-4H for qemu-devel@nongnu.org; Fri, 13 Jan 2023 15:01:56 -0500 Received: by mail-wr1-x430.google.com with SMTP id b5so879197wrn.0 for ; Fri, 13 Jan 2023 12:01:53 -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=tt1mSx+5mpU6vHqq0Q13XSPghb0/iRRovVdL8d0eEs4=; b=Cn2mKzV6ctZxmYKSeDpjr1h/46sokNPZxnhqsyq9C4ZKQJZgtxB03U5xSMilrwXxVX E40iS+jhZ/l4JE/VQMeeL2pJ0eRed0kMVJ4m3KUUG5bxiVp3Z4nejh7Fx4l1bvkQwYDM aM3tc4wSGT9EZcdVFCl8C+0bP10TKBNmpwpdgEbHDp1QaBeMIis9VOZ4Eq+A+UNsIMcq wSHz3kXSfzcClpRU2nPSTHkEIAX0dL3Ofxo2OtvhyPdJY+wCJY+sGlppNT97B0rmN7eB 3GMk4U3PmZXWy+YsBo6fbqTd3KOw0txTdYnMsZ7NzLH4+7sEReKvZbqNrF7JXOwZZZbW AbMQ== 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=tt1mSx+5mpU6vHqq0Q13XSPghb0/iRRovVdL8d0eEs4=; b=yk7uvltuHCViiwLLtkj0BhFzVmECH8fA4pPSnXUnlQVBc0cCc/eL//uE2FHG1NQWv1 m/Ur68rJoOY1hnylYiuPpSOOukkSW/iU0djtm92+4FMW/WByWHPz+0km9+viLTuOnJEx wemwZIrcxH1bmsCs4WUw/305eXBwoc9S1O/EtJkN6WxYKPGzs1vU5stwxTlaiYbGL8V8 uSQi0udl4U/QcsqZSSYnC4b/aVhwkibW4C+7sao0ESP4xIJIQlUTq9BUfABjqD52y3/e PizQiZJjWQt7ca2z+mmvIM8X3p8RDj3WKFumOdEFuxv92gHt9wqHcuao2Rb2lEsPYkcc 15qA== X-Gm-Message-State: AFqh2kr7Kj/FS2s2w/zG+OeZInVBOe/srLQ03gQ4scHolYsBUVEubER3 g/aG0j/PjCWF7HeajGSkm2wN45kTqb3UKtd5 X-Google-Smtp-Source: AMrXdXtTL6D44qTH0r/JeMhSbTQWTT6SDAl+BPXmv3UqNUxOACPqZFSiiTntWD2qbP94eQCGMNHM0Q== X-Received: by 2002:adf:e181:0:b0:2b1:c393:cbe with SMTP id az1-20020adfe181000000b002b1c3930cbemr882252wrb.11.1673640112416; Fri, 13 Jan 2023 12:01:52 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id i6-20020adfe486000000b002423dc3b1a9sm19290078wrm.52.2023.01.13.12.01.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Jan 2023 12:01:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , qemu-arm@nongnu.org, Peter Maydell , qemu-ppc@nongnu.org, "Edgar E. Iglesias" , qemu-trivial@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 2/4] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() Date: Fri, 13 Jan 2023 21:01:36 +0100 Message-Id: <20230113200138.52869-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230113200138.52869-1-philmd@linaro.org> References: <20230113200138.52869-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org QOM *DECLARE* macros expect a typedef as first argument, not a structure. Replace 'struct IRQState' by 'IRQState' to avoid when modifying the macros: ../hw/core/irq.c:29:1: error: declaration of anonymous struct must be a definition DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ, ^ Use OBJECT_DECLARE_SIMPLE_TYPE instead of DECLARE_INSTANCE_CHECKER. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/core/irq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/core/irq.c b/hw/core/irq.c index 3623f711fe..3f14e2dda7 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -26,8 +26,7 @@ #include "hw/irq.h" #include "qom/object.h" -DECLARE_INSTANCE_CHECKER(struct IRQState, IRQ, - TYPE_IRQ) +OBJECT_DECLARE_SIMPLE_TYPE(IRQState, IRQ) struct IRQState { Object parent_obj; @@ -68,7 +67,7 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque, int n) { - struct IRQState *irq; + IRQState *irq; irq = IRQ(object_new(TYPE_IRQ)); irq->handler = handler; @@ -94,7 +93,7 @@ void qemu_free_irq(qemu_irq irq) static void qemu_notirq(void *opaque, int line, int level) { - struct IRQState *irq = opaque; + IRQState *irq = opaque; irq->handler(irq->opaque, irq->n, !level); } @@ -120,7 +119,7 @@ void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n) static const TypeInfo irq_type_info = { .name = TYPE_IRQ, .parent = TYPE_OBJECT, - .instance_size = sizeof(struct IRQState), + .instance_size = sizeof(IRQState), }; static void irq_register_types(void)