From patchwork Mon Feb 20 11:51:07 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: 655076 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349021wrc; Mon, 20 Feb 2023 03:52:01 -0800 (PST) X-Google-Smtp-Source: AK7set85DWa37/MtaNXwP8yVuSHjEQhzH3QEH7nppubaEkoeYlrgaQaHE/zmQJYYGiDOMXyG7cjx X-Received: by 2002:a05:6214:1941:b0:56e:b16d:ec93 with SMTP id q1-20020a056214194100b0056eb16dec93mr402810qvk.4.1676893920963; Mon, 20 Feb 2023 03:52:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893920; cv=none; d=google.com; s=arc-20160816; b=J5+I/QopNb/qO1MjgnamBGAIgkxwiD5zzQnFnVnQ83CwWlnUi2WyrYgyZmonLonqPt Cc/YML7PjOe2vQQWLfuwx1T5rF1ICv+F1wYJAjf2kGHxopvV2F8YhE1Yt1UFQi40qNvQ mlIVpc4EupsdkfFENUeN7Q/cZBn9qeUpxSvNOcYIQPj595pTxJJvY7uFocdVGeWCTk7F 450kp+FJhTYHWOB6FXRWUzbLPQHXN+2ABY2WDBnWgRnYSD0MQ2bX+oK/MBEoG6m9ZaC9 VC107/OwJ1eNRrJAbZwtkYr1NQJO4d6JNV+lnRECbSL83hWg+obsLhWWW1Q60Rak3ppu rZDQ== 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=t8xMWpWXatWsCS1MK+NnKnpC4b3JmUSx4NHWxDCryRg=; b=KxCl2oycgVoSmLUJED2A4iQDpKvqHCTETma3BG6miu+TCdyD1f+7EvSI9NNb8COpic VrUmlykq/JU8C0vfhCm7LhTL86MzveYwCoRSUS2WMLNynG6YSc05QPm+GIqhCE/vP/sV FXkdwWo6nynFbgcAFTnAiAWjFr9v0Tu7s/y/VHCFp/P4RbqT0+EaOomLbHWbXmGb0h/l xEpPr0+BS3ZdGdZKowgckeI+rZB45q+/DCiOkbSrhufb99kDIE9CUg81jTrmLJzQsBlr AmRCUlSSmHWk7cg3AIduJ4bwRjuB4f1bQwz7cfnD0HMcm/BIVgVcsZXHgc8LZTJNyAn7 7+ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=br9d2h2t; 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 q30-20020a05620a025e00b0073bcf9a8a0esi6012799qkn.715.2023.02.20.03.52.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:00 -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=br9d2h2t; 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 1pU4hb-0001dq-VX; Mon, 20 Feb 2023 06:51:27 -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 1pU4hZ-0001cA-Nw for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:25 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hX-00055X-Im for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:25 -0500 Received: by mail-wr1-x42e.google.com with SMTP id c12so866639wrw.1 for ; Mon, 20 Feb 2023 03:51:23 -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=t8xMWpWXatWsCS1MK+NnKnpC4b3JmUSx4NHWxDCryRg=; b=br9d2h2t5NT/HK2RCMGPGHRjVsTeYZsNSP5DvLhVmnAiRQnxCcx3YMlYjfi8obyMLL MUR5yPYHp1Elgn77COhdHaN6/M0gHxIlOV85PDNAgb6vpqT5FA70XDKY860RUQPwYIG6 F5nq4/tX/twEAF4afZUkO1MW4yMe4oyXF6CAL7fqCweD1vpwlHC3X41FOpX6lI0qklPr u+0AorwaZjDRFlJ3n/U85ifZEzh8HEmrMG3Hx1uoQK6VumbfDw0A6tYF3f0BzcXYEpZJ REblfhG40Pna0GW7CzZbD7VQTTo3n8gW4rk2xaWBDwnTnLvpjGjWWUKtcs5Or16ECzm8 EG0Q== 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=t8xMWpWXatWsCS1MK+NnKnpC4b3JmUSx4NHWxDCryRg=; b=WuFaMibZ+usV+ks5lyrWoVN6K4nnwTwNuIHcd2O+Nc2fcZIvCskooAQimEcVSw6NXu gRv3XUDMogIGupCogGbQndg+SXzjv2gQ7is3pU8mRMZqnuE0uNz7tASFLIuZkkMHixZ4 5iqaSMvpPivHHJhtGZ03nnHYIFFrRmW7J3VNTx+UxD3//z3XdzuXkiqLdqHKBeWU/73y XEVDlGPFDWRFeXmEqPnJMa9nXvsqubnkW+P3hMiTlI51IOSU8b0IepWphzRxzHebJM13 GQ0KK6scWpNM5Y1zb110G5NEdTTHmsqVdhroZF6ovgH18sKliDchaFFgPr6UqI1W3CKJ Ru6Q== X-Gm-Message-State: AO0yUKUG2mx61lWPgW1cnd1Err0lMEdbERNb/4p/ysE8soQpa73rwYgt gF2PXDR9QAVBws5Slo9cEgy+/Rt1+57W6hN2 X-Received: by 2002:a5d:4dcd:0:b0:2c3:e868:cf54 with SMTP id f13-20020a5d4dcd000000b002c3e868cf54mr745448wru.13.1676893881800; Mon, 20 Feb 2023 03:51:21 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id w2-20020a5d6802000000b002c55efa9cbesm1550419wru.39.2023.02.20.03.51.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 1/8] hw/gpio/max7310: Simplify max7310_realize() Date: Mon, 20 Feb 2023 12:51:07 +0100 Message-Id: <20230220115114.25237-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Since &I2C_SLAVE(dev)->qdev == dev, no need to go back and forth with QOM type casting. Directly use 'dev'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/gpio/max7310.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index db6b5e3d76..031482d939 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -183,11 +183,10 @@ static void max7310_gpio_set(void *opaque, int line, int level) * but also accepts sequences that are not SMBus so return an I2C device. */ static void max7310_realize(DeviceState *dev, Error **errp) { - I2CSlave *i2c = I2C_SLAVE(dev); MAX7310State *s = MAX7310(dev); - qdev_init_gpio_in(&i2c->qdev, max7310_gpio_set, 8); - qdev_init_gpio_out(&i2c->qdev, s->handler, 8); + qdev_init_gpio_in(dev, max7310_gpio_set, ARRAY_SIZE(s->handler)); + qdev_init_gpio_out(dev, s->handler, ARRAY_SIZE(s->handler)); } static void max7310_class_init(ObjectClass *klass, void *data) From patchwork Mon Feb 20 11:51:08 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: 655079 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349219wrc; Mon, 20 Feb 2023 03:52:37 -0800 (PST) X-Google-Smtp-Source: AK7set9UFppxkhGLkpR9ZWH7v7JdxbgRXHd9ip9HFSuAR2yd57IjzRAQ9CZPI8mCxZu9OXtPj+Kz X-Received: by 2002:a05:622a:389:b0:3bd:1835:b00f with SMTP id j9-20020a05622a038900b003bd1835b00fmr356423qtx.20.1676893957135; Mon, 20 Feb 2023 03:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893957; cv=none; d=google.com; s=arc-20160816; b=E37tnqBiAITVhA+yelH2S5ZQ/e4LMHw//rKCOELBI8Q880xOm2dibxqeY7rl7u2NlW ktgefXSnCL88de7dxQ5giLlqxVhiSIMleNzkhuXg+al6U7lgEhS9DbeilC4etNp373im BKsXd+X4NaNAzFCqP08dv6FaTZoLAlCTrmcofFepWFn+UYjFvCUEi1VOS9c7z0AVr3UB zBIR/eAiLPvrAk2VW4Yjqag4/xAwtsWimNEKGYxlm9i9iT+fFMNP3t9zwhAChqKD2hCU 77CK3wZ4Oi4j38TjhQl5KfG6DCjfK4pQgyrVmI9nDlQJyI/IwB9eq/xdFG27y3/nhAJd 1zWw== 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=6NhaLGNCVQPhv/J8sWGZUAAWnfpTLonyUi96ru8QtrA=; b=Gu9I0s+9s8L2Swwl5wgIbGvq2B9pxaNmm9UH4z/yJlG1ao2wuSnvTmsBBYPQ7YV3CF Pg2kwTdQv6YSILLbBjc5TUGBDDkhF2gu71aeuJ8Lx6ak1vh4YJOBoXZ9ws4mjGk9p/GL mLl81vpt0YaWJ6ZaZAmLXsxJHa6ekgyBoNzlls79tvm7iAn7+QPEcZZz/qPNGksKbZYF XZuL9ZSJLkV0UFCqcnSpejlfUNT4uTwC99VvU7+SbFi5yeiOD1AHmp/X4+j96JyYAr8N OFP2N93DPc2ItA0HEfL9Ksz8A6b/tzdWB+B7JKpO8dgd7JIjFOmFuyo/qv+ZyjWkzbtG kqtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AVPi6Wx6; 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 t21-20020a05622a01d500b003aff7f4f8e2si9890108qtw.235.2023.02.20.03.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:37 -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=AVPi6Wx6; 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 1pU4hf-0001gh-SX; Mon, 20 Feb 2023 06:51:31 -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 1pU4hd-0001fk-SH for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:29 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hc-00055z-Aa for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:29 -0500 Received: by mail-wr1-x433.google.com with SMTP id 6so461987wrb.11 for ; Mon, 20 Feb 2023 03:51:27 -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=6NhaLGNCVQPhv/J8sWGZUAAWnfpTLonyUi96ru8QtrA=; b=AVPi6Wx60NvkshlJ17yAiwwDjq5+mjehWJFkHA+HyJ6PS9IgNocQMHNfphzPx+wA6L yT284zu9GpMltWIhe9fB3r4uD39QYXCmkNZ3EU61n3KsfxHhkuXCtaEq3VKkXWDwOEK3 b93EeLDrKLSTCKIPzm5NCy8LJMNsPWCWd6vT+hZ0Nt19xW5P4cTYUWw1DJyAhAnDyhz3 rjjDlb+7Zgqs0VAk2bom6HZv836OrxzEq0xQt8UmOr+zROPx1YhhUg9bmunSU35VMPRS G7FCOFCAXsIxbUOvN58uYqfLJYKmdBhc7RIt5jUVNQdlC3lzV10EDApXnRcsmYlOz2J1 0IEA== 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=6NhaLGNCVQPhv/J8sWGZUAAWnfpTLonyUi96ru8QtrA=; b=1S78xsBrVSG39JVDXi39pSnOitWigBjyvyxwinQ52sWiWORpRexdzMrqQwl3wDQI5U 2Yj18N/C0Abiu0Bg/IfnaEvXEIGXSuvUuRLw1YNva0STFCwktssmj/q+UNgtad1bIB3B srfJ9jVXcB2dsYhFqeTG7Dw5dptEWtLWUIDou65tMG9n5toKf1ZP1rvbmEaFDknTQ9Zk jXGCyHhXhiYHfKJLNGqbxT7agkVuk55CoTQL26UPUu9J1xuoE1n7K8PLlgbpWkBiEn+s od0kCMZeU9J/QOfOrZzwUY/jPja2cg0HxGHyLcH+p0k9oRH4z5aMqKiAXMUO282lhERk 9MJg== X-Gm-Message-State: AO0yUKVILAjw1oJb19S/8knNKQMU/Gw0eVJE0DjWact2peMkM03x2vae +3r+HG28cM0MTKaUaLIyW88g57Bc6y0BK7Bo X-Received: by 2002:a05:6000:18b:b0:2c5:4f35:1b2b with SMTP id p11-20020a056000018b00b002c54f351b2bmr639360wrx.28.1676893886786; Mon, 20 Feb 2023 03:51:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e28-20020a5d595c000000b002c54a2037d1sm2407842wri.75.2023.02.20.03.51.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 2/8] hw/char/pl011: Un-inline pl011_create() Date: Mon, 20 Feb 2023 12:51:08 +0100 Message-Id: <20230220115114.25237-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 pl011_create() is only used in DeviceRealize handlers, not a hot-path. Inlining is not justified. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/char/pl011.c | 17 +++++++++++++++++ include/hw/char/pl011.h | 19 +------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/char/pl011.c b/hw/char/pl011.c index c15cb7af20..77bbc2a982 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -19,10 +19,12 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/char/pl011.h" #include "hw/irq.h" #include "hw/sysbus.h" #include "hw/qdev-clock.h" +#include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" #include "chardev/char-fe.h" @@ -31,6 +33,21 @@ #include "qemu/module.h" #include "trace.h" +DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr) +{ + DeviceState *dev; + SysBusDevice *s; + + dev = qdev_new("pl011"); + s = SYS_BUS_DEVICE(dev); + qdev_prop_set_chr(dev, "chardev", chr); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, addr); + sysbus_connect_irq(s, 0, irq); + + return dev; +} + #define PL011_INT_TX 0x20 #define PL011_INT_RX 0x10 diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index 926322e242..d82870c006 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -15,10 +15,8 @@ #ifndef HW_PL011_H #define HW_PL011_H -#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" -#include "qapi/error.h" #include "qom/object.h" #define TYPE_PL011 "pl011" @@ -57,22 +55,7 @@ struct PL011State { const unsigned char *id; }; -static inline DeviceState *pl011_create(hwaddr addr, - qemu_irq irq, - Chardev *chr) -{ - DeviceState *dev; - SysBusDevice *s; - - dev = qdev_new("pl011"); - s = SYS_BUS_DEVICE(dev); - qdev_prop_set_chr(dev, "chardev", chr); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, addr); - sysbus_connect_irq(s, 0, irq); - - return dev; -} +DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr); static inline DeviceState *pl011_luminary_create(hwaddr addr, qemu_irq irq, From patchwork Mon Feb 20 11:51:09 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: 655077 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349193wrc; Mon, 20 Feb 2023 03:52:34 -0800 (PST) X-Google-Smtp-Source: AK7set8A/IRli1kqnI/pC+b8swolhDcOTL5if0okSFwXGZLrWMmGASx4EjbtkrKbkLmGCY31xPRH X-Received: by 2002:a05:622a:3cc:b0:3bd:140c:91ed with SMTP id k12-20020a05622a03cc00b003bd140c91edmr40669qtx.52.1676893953993; Mon, 20 Feb 2023 03:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893953; cv=none; d=google.com; s=arc-20160816; b=KHqm7J4MY3SeGI5Jj72CR27aglSd20l+vD76jjveUHOb4c4MOMhL8sKmkdZii3Nd77 PMyfBeC/iByiaehuOH9PU9sz9wDx15R5jBS1iSLrBGX7NRIlplY9KfeJTAPMpYuHIGCd Z1M0EJjRtEejqUXhmp7DB3NSAfb6ODTo9J/sPH9OZJtBGz8FtGJzSAp8Pe+I2cgO4Wn2 Kd0daFanrfz4ghy230x1lTovymF84aBrmdDdFXZ5IORhsD38UQw/tPTtB8rXCbOHr7dx G6iVK6hAAQZOHyFl7yl8L4myIkRIR85JYV1o6JRwylCePxk1OFOIXlDDVUktYVNH6SfZ 9uuA== 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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=YCbUOoNktG6wKRXOB3MPkxyPkH7cYVT2mtVqgTdeFNMxbqU7DFDvwMm2J035bH07VG UUFkeVauLOLRN8A7/p9gBDRyjvKDTS3WZX6Hf5+YllRxKmawGxmeKCF56xng2bSNwsIX 7mHOqxLyNJLzzoI8wdJAGPpOFsMSXi6lFzFCOskU+5m2V0QseyABOBLFgKcjkgjspGJb Ykn8G3GF9BRQ7jcVKTrJgv5qIaWOuqNrOOgwmoPb9vT1bV5erVgM8KoFlRXD1y5tvbND f0l6p0WZUlqlB/QXIuBUbV6SwYj4myLcQ924/EO2xSczNUr7BY3NtQvjYUfEoqQkV6mN lnrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VDZ000fo; 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 bn4-20020a05620a2ac400b0073b2dc1946asi9105940qkb.685.2023.02.20.03.52.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:33 -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=VDZ000fo; 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 1pU4hj-0001jB-Tu; Mon, 20 Feb 2023 06:51:35 -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 1pU4hi-0001i9-Ud for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:34 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hh-00056R-EU for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:34 -0500 Received: by mail-wm1-x330.google.com with SMTP id az11-20020a05600c600b00b003dc4fd6e61dso812046wmb.5 for ; Mon, 20 Feb 2023 03:51:33 -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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=VDZ000fopMnMKslEBLL9pEqrmVFf6Xs+q7tczg18RLnpAu5FoBKA0uFfeC37vrT2jg SN2ndwkQHgN/DevtloSzAbEot55W2BfIBGZCthMfcJTNzuOfxJSOQECx8gNwhG0ijIDp Rf6mvFysejO1GmNcFGdhh2UPPxKJ5sCOLdixtObDrSk44krnxezNyqwgDnd0g+YKUD10 K1PQBKDMbx6l1y/WMM4/Ux6YgtbfClWWKL9H7RaP610wjjUDFLI9W0NAIvB43cdBhHju Pkmcnmhxmp4Te5xh/0Fn6TmWRWIJWSqoNnvhJn4GPcmYpJYMZo9z4hIvRHzmIwygacUN i1ow== 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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=1kG/Wr3BX8vfLmyRloglVCih50Yk87VhbWIa5amzsWfInmxmehUCcD6AuCUe8PMI1S B84l7dwAp5mKXP5Helr1jEZKLAGUgOsrSgCiHVJZHbk4RxbLFCzRsDjLyeQA+M6S3ICa /oV1J3DD+b8Wz6q0QwZk2hxpNGgOce1G8GXe7GPYzfbU7xKZQtMwK7ku7c4lMLD4qjTU AEBF0AlNhcftFtdb061T/qpXs7ZPugoO+n816MF0QduN3gtMBqPjo88o12C9bwpr6x1K FZFK5HBmwp3Y/bUvNmfPzGvIReOpC0XxtFjc1xeUuAbngmzcZ61983fLlaOxRrLoLm8H gVFQ== X-Gm-Message-State: AO0yUKWVGLKTv2oEpB6Z/DpiSa+DLn/DUhs37b1sjXvyO3shuIZSJQaC 7hVvHbikk7goaRfw+S/Ptn5qFwQtIa/AFBzU X-Received: by 2002:a05:600c:1895:b0:3e2:589:2512 with SMTP id x21-20020a05600c189500b003e205892512mr780466wmp.21.1676893891694; Mon, 20 Feb 2023 03:51:31 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x8-20020a1c7c08000000b003dc4480df80sm89905wmc.34.2023.02.20.03.51.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 3/8] hw/char/pl011: Open-code pl011_luminary_create() Date: Mon, 20 Feb 2023 12:51:09 +0100 Message-Id: <20230220115114.25237-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 pl011_luminary_create() is only used for the Stellaris board, open-code it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/arm/stellaris.c | 11 ++++++++--- include/hw/char/pl011.h | 17 ----------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 67a2293d35..f7e99baf62 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1146,9 +1146,14 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) for (i = 0; i < 4; i++) { if (board->dc2 & (1 << i)) { - pl011_luminary_create(0x4000c000 + i * 0x1000, - qdev_get_gpio_in(nvic, uart_irq[i]), - serial_hd(i)); + SysBusDevice *sbd; + + dev = qdev_new("pl011_luminary"); + sbd = SYS_BUS_DEVICE(dev); + qdev_prop_set_chr(dev, "chardev", serial_hd(i)); + sysbus_realize_and_unref(sbd, &error_fatal); + sysbus_mmio_map(sbd, 0, 0x4000c000 + i * 0x1000); + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(nvic, uart_irq[i])); } } if (board->dc2 & (1 << 4)) { diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index d82870c006..d853802132 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -57,21 +57,4 @@ struct PL011State { DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr); -static inline DeviceState *pl011_luminary_create(hwaddr addr, - qemu_irq irq, - Chardev *chr) -{ - DeviceState *dev; - SysBusDevice *s; - - dev = qdev_new("pl011_luminary"); - s = SYS_BUS_DEVICE(dev); - qdev_prop_set_chr(dev, "chardev", chr); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, addr); - sysbus_connect_irq(s, 0, irq); - - return dev; -} - #endif From patchwork Mon Feb 20 11:51:10 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: 655083 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349323wrc; Mon, 20 Feb 2023 03:52:53 -0800 (PST) X-Google-Smtp-Source: AK7set/TKtV4++OZw6hkZPtrRP3iEX4FhTKOxu5vdopDTbmeU7uPUtpSyGs4/1CLOx4UectpNHmn X-Received: by 2002:ad4:5c46:0:b0:56e:a630:2626 with SMTP id a6-20020ad45c46000000b0056ea6302626mr1448578qva.45.1676893973475; Mon, 20 Feb 2023 03:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893973; cv=none; d=google.com; s=arc-20160816; b=PuR5ntYIdS0go0hmyxB0w4z5gSUmE9zIxKBEOeWx5tIgEamEDSAtfqSRSZ04NLsZzH 99lUxKKzXbXIZckvpQesydXrBlQ0iiV6pOg44kZ80+3f17qizpIZEelC1lXtPw7tAtUl N+QHMl0TNt5hM9Gq8VD11arQQYZVZ9RPnPOh/VdpgW5hi9xQ2fSnJ8pQZktgStRnTUYc I2Q5ElF2VFXqd2WTRHKtgPkCaUXYYKqJ4YxOEQJd23t++DW28olPPmJYRft3v4d8BvbV BizYJ3z3yIhx1GV9RlLG8kIUUxG66esHGqn9JbkE7SGluz9+dFlioh9+V8rNJw5UmdUC 8zUA== 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=czXwdqthQ5iacnX5do69zMxtKzZ1dl3WlnS0e9zwEDE=; b=fpDNi/WwkCy36vr1vXjV0MyafWnky3yt3kWbXGd0SMTCM44Kj4bYBK9ZiSmpa+TDCY vwHyXroaK2xrAN57oiZg4D5ObC4fHd45FFPIznSMsm5yRkDBlYXV03U1jMZd5+Q+xeiS 9YmV//kCNXknC2jIKu++DE01KnieRzqrIzQ9xYKtPva7TQJYIoTUAeaCV2EDujkf3V7V uaPyMqDEkZMaLyvmSIO1mBhJEaI7sLAIbaDbgdcqL6oTYiMpN1PYsmBZZyw0tTaoeeAF rIFz2cHzsuhvCEXW29781KWTynOT1neT+AlzaQwNco3c/VL4DEGT2FQSuLO+/nxt30rR 3PHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2DjAQfn; 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 i3-20020a0cf483000000b0056e91fec1acsi628163qvm.293.2023.02.20.03.52.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:53 -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=b2DjAQfn; 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 1pU4hp-0001kb-Hk; Mon, 20 Feb 2023 06:51:41 -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 1pU4hn-0001jo-Vl for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:40 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hm-00056v-E0 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:39 -0500 Received: by mail-wr1-x429.google.com with SMTP id t15so968263wrz.7 for ; Mon, 20 Feb 2023 03:51:38 -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=czXwdqthQ5iacnX5do69zMxtKzZ1dl3WlnS0e9zwEDE=; b=b2DjAQfnxzKe3h+ZHHA22LUFtI9mytzQYQysG0K7h+w9xmboePDKh2M9B1k2BOzEO0 YkSfC5cqUvU9v7E2F4BgcyG44uXVe+ZXvG4vVkZeB45t6fh19w9UXjevYSD8FIXZpfPY 78D22PzQQtESoOKHkIGF07q/UGkIzXrm86eB7k60m/4rJ8Td7esoRBHZ3ggtfUD//Tv3 n4B9evQhpc+NVdS70Wpyj4kcEiz+8nZspxzs3ZlaXbQL4AvkwP0onVIDGjtHJZInsMwO N0SOMAauxRXy9WUW5oEb2fxoJDiqjX+fXdpdFUTL92By/3RPk0pN63YJ2SzOPgesXs5T /SAA== 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=czXwdqthQ5iacnX5do69zMxtKzZ1dl3WlnS0e9zwEDE=; b=eEz1ls+kLr+/mYGq1wyCCJUO7RlITorI9C3Z+JULZQm9kW9DorVCPaVfiTatXUG9rJ f/Qh+qQ8nuxNanPe9Ipk8u1tr//IOUy/D9Nye5VXs8ELzdp0YHY6zPwgUJ0KL7T58sSV jDz22AD0ldThqNUEt+DWG++KOo4JPbrly91zwa7txov0ynn5fT54AwGJ2lgIf255d9Ft CXNJlkigy2OMHp/gwh3tov6RHK4KRLcCMnKBNAuRbp7VRVROelVOdp0AjdEjOYK0SH2G IOHWb58/hF8CljruOrfelyFMARX203WqojKkrHdsKMuIRcR0LmRCCUsz6FSlDpGAZOHo RGlg== X-Gm-Message-State: AO0yUKVkx9MdDY8/6mbNuDcZRN9BUq3jTV/97Vk0ZrO4ljZS/h4k37ue i6dVdjbaNwb0aSr0fFUbc2FKNsH1GR9qo6Bv X-Received: by 2002:a05:6000:1c5:b0:2c5:941d:26b8 with SMTP id t5-20020a05600001c500b002c5941d26b8mr431674wrx.15.1676893896874; Mon, 20 Feb 2023 03:51:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l18-20020adfe9d2000000b002bfe08c566fsm2001141wrn.106.2023.02.20.03.51.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 4/8] hw/char/xilinx_uartlite: Expose XILINX_UARTLITE QOM type Date: Mon, 20 Feb 2023 12:51:10 +0100 Message-Id: <20230220115114.25237-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/char/xilinx_uartlite.c | 4 +--- include/hw/char/xilinx_uartlite.h | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index 99b9a6f851..180bb97202 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "hw/char/xilinx_uartlite.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" @@ -53,9 +54,6 @@ #define CONTROL_RST_RX 0x02 #define CONTROL_IE 0x10 -#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" -OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE) - struct XilinxUARTLite { SysBusDevice parent_obj; diff --git a/include/hw/char/xilinx_uartlite.h b/include/hw/char/xilinx_uartlite.h index dd09c06801..753d3a453e 100644 --- a/include/hw/char/xilinx_uartlite.h +++ b/include/hw/char/xilinx_uartlite.h @@ -18,6 +18,10 @@ #include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "qapi/error.h" +#include "qom/object.h" + +#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" +OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE) static inline DeviceState *xilinx_uartlite_create(hwaddr addr, qemu_irq irq, @@ -26,7 +30,7 @@ static inline DeviceState *xilinx_uartlite_create(hwaddr addr, DeviceState *dev; SysBusDevice *s; - dev = qdev_new("xlnx.xps-uartlite"); + dev = qdev_new(TYPE_XILINX_UARTLITE); s = SYS_BUS_DEVICE(dev); qdev_prop_set_chr(dev, "chardev", chr); sysbus_realize_and_unref(s, &error_fatal); From patchwork Mon Feb 20 11:51:11 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: 655081 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349252wrc; Mon, 20 Feb 2023 03:52:41 -0800 (PST) X-Google-Smtp-Source: AK7set/eOlWALLdAfM9k9znBraSjbgbDf5z00ShwmtByM9dsIszGApdDQLyiOQP3HuTveG5YaXJr X-Received: by 2002:ac8:5c55:0:b0:3bb:7875:1bd6 with SMTP id j21-20020ac85c55000000b003bb78751bd6mr249386qtj.21.1676893961482; Mon, 20 Feb 2023 03:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893961; cv=none; d=google.com; s=arc-20160816; b=oASoYpMSRcKVgCjojmyXg68sggPt2ficar+mzQqlhL1QYNaVBjJe2Xc5KHwN8/3dsA FRM5SMoM4DfyDW5Kgg0z6gzy7NuYtPRa19L8HtLzWvm+6OsEy7BhrAuYCC5FOFXd3TL1 3iy9Yc4w9VJpyBgOFiJmVf+3bWIAF+u7/EgnoPkXSUvzsms1L657QMW4YZCUAMOxS9j7 RtX4AUGsyxc/rF7yXA/HPbIA82JvsUtcJijfciHhZNPFNE5+3k38kNa7OSDy0SwZOxuI nFtBtg0O7qQ4SGlnIy+OEGmJr0d5MrkitZp6h7ZHn0gRzevKuCyrQMU1zDPPaHfvtCb3 XoVg== 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=8vDECSWkZJOzUDc5E3O4noT+X5MoGsjXzgyJy24749w=; b=BxYbPcIGGJbRsW7WzEFHr2HYOuwMTBMwDQd6oZtyykL28Sq+VxliXPFXwbQrZtYyIA j+fXMn1WVGQHkTgPaVVtes6mCVjlJJuuJiolb5jF+v6nm0uFDpJA+SSisZvYVUtkkalg sMot1Bu5jjKIG/t9JwUylMF5OvIjZOZZk5z6O07lRFyUbhGsoX2Y3iflWCCEaRwYBQ1q fJ3/XEomfIma0YzZJy/h6UiR+qLxb3oC3ZeejT29kBBpbyqSEaX6TapmE0x2FsKCyj97 rQM2Ooo18dyhOtckUgEACGWry5RN1G0fjhMGVOP0wJSwnwdrqEhZB8ViW/8vu1A2cDra C9fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HnHhfq67; 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 y20-20020a05622a121400b003b81d85ee99si10054937qtx.713.2023.02.20.03.52.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:41 -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=HnHhfq67; 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 1pU4i3-00021L-6i; Mon, 20 Feb 2023 06:51:56 -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 1pU4ht-0001wH-OU for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:45 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hq-00054k-Qu for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:44 -0500 Received: by mail-wm1-x329.google.com with SMTP id bg25-20020a05600c3c9900b003e21af96703so187359wmb.2 for ; Mon, 20 Feb 2023 03:51:42 -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=8vDECSWkZJOzUDc5E3O4noT+X5MoGsjXzgyJy24749w=; b=HnHhfq67peQnCtNeIz+oc3cKE2roXC8p42BRL1HBuOc1nLFSgPc2pNfllC/gdLtGlF ZxWlC2HfLAFcLBljOWmAIhwAmDddRUx46zhJCimqrrQ+QAvJ+HgMSEzVf8u3rCMpzYYd /W7XxQEviDtxVlOQ+PhL2JhdTWfJ6viTqapt+0WBEitcUMHHAYQ0Q3i+crqH4QbpjWbg MoBeP8AehzKN5TxtTFLcWjP0ZDiCQyrOO/2jbWC18E3gIZPz0340JauSOjInL5koalGr 8jistWO7wnIcJos4JilROX/ewhEAvD2a7F7EyA5MEQS3WnlnO50UjpI1klsk3+GPllnh P8bw== 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=8vDECSWkZJOzUDc5E3O4noT+X5MoGsjXzgyJy24749w=; b=y3rViCSL6xe+J2HExG8YSx07QIOjjhVRCiR+9szIhi5lvecA1j306eUSN7llzCdNYB Pt5l9A56Lr+Hem5cZ1hdmyJg83PtZJnU8gwV/QxnX6/U6pH11zjFH+5Dwhsd5dcvcaVx CjMZl1e2P5jY2LJwRnIFGNc4/K1SLY9D+CW41pBo8G30B/XtxAGjGa/oGoRq0d+BZr9E BSoYFMhUABBHIhoEl4K1y6RPAA6ssQnzJugChRSoRC0zw54XtXiDhoMSQvdBU3Pdfjx1 7gp4JFBCNgvHwGlFnB3j8JUIVw+Y42ApX8fqwLiyggdEQ4bVheNjHEuo+sCfRcDhF2zW 9f7A== X-Gm-Message-State: AO0yUKXiqByMOYPgERwl3Tx0CSB59+QE+T/afkhj+gg9yDd9gfC0WPuu 4r5Io171yciu5v6Ov0RQXMJiuj9xb6omtS6O X-Received: by 2002:a05:600c:4aa7:b0:3e2:59d:431d with SMTP id b39-20020a05600c4aa700b003e2059d431dmr7399248wmp.2.1676893901892; Mon, 20 Feb 2023 03:51:41 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l37-20020a05600c1d2500b003db0ad636d1sm11717434wms.28.2023.02.20.03.51.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 5/8] hw/char/xilinx_uartlite: Open-code xilinx_uartlite_create() Date: Mon, 20 Feb 2023 12:51:11 +0100 Message-Id: <20230220115114.25237-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 Open-code the single use of xilinx_uartlite_create(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 7 +++++-- include/hw/char/xilinx_uartlite.h | 20 -------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 9d959d1ad8..505639c298 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -100,8 +100,11 @@ petalogix_s3adsp1800_init(MachineState *machine) irq[i] = qdev_get_gpio_in(dev, i); } - xilinx_uartlite_create(UARTLITE_BASEADDR, irq[UARTLITE_IRQ], - serial_hd(0)); + dev = qdev_new(TYPE_XILINX_UARTLITE); + qdev_prop_set_chr(dev, "chardev", serial_hd(0)); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, UARTLITE_BASEADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq[UARTLITE_IRQ]); /* 2 timers at irq 2 @ 62 Mhz. */ dev = qdev_new("xlnx.xps-timer"); diff --git a/include/hw/char/xilinx_uartlite.h b/include/hw/char/xilinx_uartlite.h index 753d3a453e..36d4e8444d 100644 --- a/include/hw/char/xilinx_uartlite.h +++ b/include/hw/char/xilinx_uartlite.h @@ -15,29 +15,9 @@ #ifndef XILINX_UARTLITE_H #define XILINX_UARTLITE_H -#include "hw/qdev-properties.h" -#include "hw/sysbus.h" -#include "qapi/error.h" #include "qom/object.h" #define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite" OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE) -static inline DeviceState *xilinx_uartlite_create(hwaddr addr, - qemu_irq irq, - Chardev *chr) -{ - DeviceState *dev; - SysBusDevice *s; - - dev = qdev_new(TYPE_XILINX_UARTLITE); - s = SYS_BUS_DEVICE(dev); - qdev_prop_set_chr(dev, "chardev", chr); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, addr); - sysbus_connect_irq(s, 0, irq); - - return dev; -} - #endif From patchwork Mon Feb 20 11:51:12 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: 655080 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349221wrc; Mon, 20 Feb 2023 03:52:37 -0800 (PST) X-Google-Smtp-Source: AK7set8khtv0bSS5ABLgOp/ny17i/bM/S7kxCfpfAKM7dnE94UNJsXF4UaLjIXGQDOqglfdpM5ZP X-Received: by 2002:a05:622a:349:b0:3b9:bc8c:c1f9 with SMTP id r9-20020a05622a034900b003b9bc8cc1f9mr9734372qtw.4.1676893957201; Mon, 20 Feb 2023 03:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893957; cv=none; d=google.com; s=arc-20160816; b=fG2nz97e3NVY2KCj9z12AFiJTzRk2YiEjWNRRdbv/VJGlf3xO3jbuSEq6Y3LAHNWoo lAFM3EYqKeHoHPvZSjAv4M5eonoQIHFYcL1a/6Qfk/gQXgmXY5ApX0tPxq+VdqyBnj0s GzwoBphz8CX/22X7zXm2XZ62y+hITG/irL361upB/a6Z/YQ+EVifCdxmBagAWGZpeZuZ 5HaTeuJI94VPu1yKiCFt6Sc7eILFxhR3DkBSKU46wIv1ILJL9nr2RZjGAP1avP7wzu8X qhoOpOgntP8ORRbs0S5e9clSmPfbK4lhop+h/APJiPKACQltbLZIXBK8GROpHMSd2sPR /RjQ== 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=9KmAzFzjUSjv0qxGwYUyPOJl5AM69yzfJfvbL6ZRJSM=; b=Y0v7O2L7wvO63L44HldAD7djZ9rDovGpX1wM4w2nOhRBrynBqREz80M584XqeLztnj 6msiRrKPqa8h4sGL6maZj0+SwI0YfrNDnOOPphpLY0TGNqAmKHsjiYkOPdz0MBItoKMu hD5YFSCNCuE9CT/GTIODwSF81S2gYhjrVnF8fx7rf2EvyuE6HqdfJ2igX3kovzXeAcfG xsVwgIAsH7TgFeC/J1h7GBPo/BnJlCGXCqpGP/Ez8d8BNalTrJlFf7cNGKy+eYw9TZni UqEkJsz/+6i6pcY6rFs/8AZms6VXl4/47TeYczWURlC9Gk+KhIpdw7UETFrkX4YFUmrd 2qkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fS8RjV1n; 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 s129-20020ae9de87000000b006fa1585a6absi9071164qkf.186.2023.02.20.03.52.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:37 -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=fS8RjV1n; 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 1pU4i8-00022u-Vc; Mon, 20 Feb 2023 06:52:01 -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 1pU4hz-000202-1R for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:51 -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 1pU4hw-00058X-MM for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:50 -0500 Received: by mail-wm1-x335.google.com with SMTP id l2-20020a05600c1d0200b003e1f6dff952so774009wms.1 for ; Mon, 20 Feb 2023 03:51:48 -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=9KmAzFzjUSjv0qxGwYUyPOJl5AM69yzfJfvbL6ZRJSM=; b=fS8RjV1nt//Qk8Wzqr38mbXdX+qAyXMqAYIX/F45S0ClGwVRhzigJuAhtrGsEARfhY t3GivPLqDBy0YTSdB3YoBhGyXfjMVriwDm7MBfBCSRsBKa/efV+2MU1S0rdHE8xpP5mp 4h0JMz3M/cwTLvzoblXkyoGM/aH8MOMtMlfI6dPNqCeR9cGbCRiW+/jai7PLR3FhDY6H Rq/T1XTidvxEBGBsijhfOJGElGkAOBqcJ+vGKzhKhR9HlczHG1uL6NO7MMelt9mxK0RG Myr9/paRmH7tKxgSgF30QChg+LGNvNepu/orSo5EtQDnnnKHXIXd/r/I3pQSIWoVLC5O 8TmQ== 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=9KmAzFzjUSjv0qxGwYUyPOJl5AM69yzfJfvbL6ZRJSM=; b=vk86JhyvHIr8l42EBKl7StEJUR2vNfe3FR3V9BfZHZgAmbTSDAJjVopYrXqN1bECal cJqwQ0gKJ+9PkV6lllPshcSr0ye33pNPF4WAQXmsndpd2Kfg9ApUeI1cDzIauw8WgOjc c67tL3ahMSEq739tSd5Zrq9GNVSei3r8clu8c/8I2RvghKAX1SWyUPfpld9oroWiVgK5 FScC1bv55jqc9kbJKo1QBqQe2ZEuk5PHMucFLXkwmzj2lxFmYrCtGOAKm0DTlfOGs5CJ g7GeJPVEpXl4w/4Uv2j3VxsREtMLpAgCXNpN7mEkFthiqHgAZd2i9f79UAhEn9eL1pTw aEDQ== X-Gm-Message-State: AO0yUKVnBDbz/3Avw+tAP+gxQSrENxBKuljIkHzksXcuEWf/ZWqrLzr7 ErYnW5MQcvECCFOTnVDAYw6fh3LcCpQ5mpFc X-Received: by 2002:a05:600c:1714:b0:3e0:c0d:75d8 with SMTP id c20-20020a05600c171400b003e00c0d75d8mr6439284wmn.23.1676893906976; Mon, 20 Feb 2023 03:51:46 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p15-20020a7bcdef000000b003e21356bddcsm14361345wmj.33.2023.02.20.03.51.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 6/8] hw/char/cmsdk-apb-uart: Open-code cmsdk_apb_uart_create() Date: Mon, 20 Feb 2023 12:51:12 +0100 Message-Id: <20230220115114.25237-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-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 cmsdk_apb_uart_create() is only used twice in the same file. Open-code it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/mps2.c | 41 +++++++++++++++++++++----------- include/hw/char/cmsdk-apb-uart.h | 34 -------------------------- 2 files changed, 27 insertions(+), 48 deletions(-) diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index a86a994dba..d92fd60684 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -35,6 +35,7 @@ #include "hw/boards.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h" +#include "hw/qdev-properties.h" #include "hw/misc/unimp.h" #include "hw/char/cmsdk-apb-uart.h" #include "hw/timer/cmsdk-apb-timer.h" @@ -282,6 +283,9 @@ static void mps2_common_init(MachineState *machine) qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12)); for (i = 0; i < 5; i++) { + DeviceState *dev; + SysBusDevice *s; + static const hwaddr uartbase[] = {0x40004000, 0x40005000, 0x40006000, 0x40007000, 0x40009000}; @@ -294,12 +298,16 @@ static void mps2_common_init(MachineState *machine) rxovrint = qdev_get_gpio_in(orgate_dev, i * 2 + 1); } - cmsdk_apb_uart_create(uartbase[i], - qdev_get_gpio_in(armv7m, uartirq[i] + 1), - qdev_get_gpio_in(armv7m, uartirq[i]), - txovrint, rxovrint, - NULL, - serial_hd(i), SYSCLK_FRQ); + dev = qdev_new(TYPE_CMSDK_APB_UART); + s = SYS_BUS_DEVICE(dev); + qdev_prop_set_chr(dev, "chardev", serial_hd(i)); + qdev_prop_set_uint32(dev, "pclk-frq", SYSCLK_FRQ); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, uartbase[i]); + sysbus_connect_irq(s, 0, qdev_get_gpio_in(armv7m, uartirq[i] + 1)); + sysbus_connect_irq(s, 1, qdev_get_gpio_in(armv7m, uartirq[i])); + sysbus_connect_irq(s, 2, txovrint); + sysbus_connect_irq(s, 3, rxovrint); } break; } @@ -324,7 +332,8 @@ static void mps2_common_init(MachineState *machine) 0x4002c000, 0x4002d000, 0x4002e000}; Object *txrx_orgate; - DeviceState *txrx_orgate_dev; + DeviceState *txrx_orgate_dev, *dev; + SysBusDevice *s; txrx_orgate = object_new(TYPE_OR_IRQ); object_property_set_int(txrx_orgate, "num-lines", 2, &error_fatal); @@ -332,13 +341,17 @@ static void mps2_common_init(MachineState *machine) txrx_orgate_dev = DEVICE(txrx_orgate); qdev_connect_gpio_out(txrx_orgate_dev, 0, qdev_get_gpio_in(armv7m, uart_txrx_irqno[i])); - cmsdk_apb_uart_create(uartbase[i], - qdev_get_gpio_in(txrx_orgate_dev, 0), - qdev_get_gpio_in(txrx_orgate_dev, 1), - qdev_get_gpio_in(orgate_dev, i * 2), - qdev_get_gpio_in(orgate_dev, i * 2 + 1), - NULL, - serial_hd(i), SYSCLK_FRQ); + + dev = qdev_new(TYPE_CMSDK_APB_UART); + s = SYS_BUS_DEVICE(dev); + qdev_prop_set_chr(dev, "chardev", serial_hd(i)); + qdev_prop_set_uint32(dev, "pclk-frq", SYSCLK_FRQ); + sysbus_realize_and_unref(s, &error_fatal); + sysbus_mmio_map(s, 0, uartbase[i]); + sysbus_connect_irq(s, 0, qdev_get_gpio_in(txrx_orgate_dev, 0)); + sysbus_connect_irq(s, 1, qdev_get_gpio_in(txrx_orgate_dev, 1)); + sysbus_connect_irq(s, 2, qdev_get_gpio_in(orgate_dev, i * 2)); + sysbus_connect_irq(s, 3, qdev_get_gpio_in(orgate_dev, i * 2 + 1)); } break; } diff --git a/include/hw/char/cmsdk-apb-uart.h b/include/hw/char/cmsdk-apb-uart.h index 64b0a3d534..7de8f8d1b9 100644 --- a/include/hw/char/cmsdk-apb-uart.h +++ b/include/hw/char/cmsdk-apb-uart.h @@ -12,10 +12,8 @@ #ifndef CMSDK_APB_UART_H #define CMSDK_APB_UART_H -#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "chardev/char-fe.h" -#include "qapi/error.h" #include "qom/object.h" #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart" @@ -45,36 +43,4 @@ struct CMSDKAPBUART { uint8_t rxbuf; }; -/** - * cmsdk_apb_uart_create - convenience function to create TYPE_CMSDK_APB_UART - * @addr: location in system memory to map registers - * @chr: Chardev backend to connect UART to, or NULL if no backend - * @pclk_frq: frequency in Hz of the PCLK clock (used for calculating baud rate) - */ -static inline DeviceState *cmsdk_apb_uart_create(hwaddr addr, - qemu_irq txint, - qemu_irq rxint, - qemu_irq txovrint, - qemu_irq rxovrint, - qemu_irq uartint, - Chardev *chr, - uint32_t pclk_frq) -{ - DeviceState *dev; - SysBusDevice *s; - - dev = qdev_new(TYPE_CMSDK_APB_UART); - s = SYS_BUS_DEVICE(dev); - qdev_prop_set_chr(dev, "chardev", chr); - qdev_prop_set_uint32(dev, "pclk-frq", pclk_frq); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, addr); - sysbus_connect_irq(s, 0, txint); - sysbus_connect_irq(s, 1, rxint); - sysbus_connect_irq(s, 2, txovrint); - sysbus_connect_irq(s, 3, rxovrint); - sysbus_connect_irq(s, 4, uartint); - return dev; -} - #endif From patchwork Mon Feb 20 11:51:13 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: 655082 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349318wrc; Mon, 20 Feb 2023 03:52:52 -0800 (PST) X-Google-Smtp-Source: AK7set/A8PHKeGkdcX664eRMD2wQwSh7937LJH37XB9rYT+PeIz2/MdjYLf7/ck1D242o0Hdto9w X-Received: by 2002:ac8:5f82:0:b0:3b9:bc26:3349 with SMTP id j2-20020ac85f82000000b003b9bc263349mr13038107qta.37.1676893972258; Mon, 20 Feb 2023 03:52:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893972; cv=none; d=google.com; s=arc-20160816; b=g6w0sHUX16ySPeCMZ2S8Qh0MxTC4g1wGVimLvFcAsTIM0j3zeptl1A/6ofONWGngub aZo35/5+qa05c5Eh2Z2MW3uxz4dfecDFEtCtU98Bbj1l1o48q+/UtPvhKIYmz9J/U2fL G1G2ykiX/lKhXB8SCfxCWOprs613rQQ7WrGZz4radey8rh8KgCStZ2XL3KJnhV07j8iw ItBftiICflG9c6DWCqhYaw6qtxnOwTynX67SVX6hlOWNW+fn+c0fi1g+viG4KP03UWML 6qFZmrhQQgM0qA5w5owxNxJ3owcAhWN/qc/k2oT9vO0HVOeMzarbHCTQ2BSkexrzC6jq eBYg== 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=2MXysM/hMTBAFKZjBf1cYIe3OiZof2SNZO7F3Jiq7Aw=; b=c4buC9mgr6g7Xn2EHf/77X5HvJ6A/frEkitNGiF6DMcsCMftvRrv71GYXJWnfSBGP5 FxAYnQIdnrirsBeRYN50iUPmNQlXTMfzWqoXci/DpIJMIqUhz6hEJ858MRLp2REGSFtT HX5OcSbMbDSt//xruINITOMtw+rZwrnPRt9b1Yq+05S+y3peTee/03szWdVz8gT2uCpN CbDQ0Cb4vOHoEgHdE/xVJpiPCZugcaYjaAc7eLQ5P6fvTMiLEk9iRKPnDzZUNgZ17io7 OSzD1cwOWHnpITtr9+FvxoVNLqjRDTurgWs1RbiNiOVAVAandPee006FiS7NcZj4zWJi JnOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jrLm4Udf; 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 r1-20020a05622a034100b003b9b407f4b4si10235324qtw.591.2023.02.20.03.52.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:52 -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=jrLm4Udf; 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 1pU4iF-0002M9-46; Mon, 20 Feb 2023 06:52:07 -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 1pU4i2-00021v-Vo for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:56 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4i1-0005AN-Fg for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:54 -0500 Received: by mail-wm1-x331.google.com with SMTP id bg28so727433wmb.0 for ; Mon, 20 Feb 2023 03:51: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=2MXysM/hMTBAFKZjBf1cYIe3OiZof2SNZO7F3Jiq7Aw=; b=jrLm4UdfOzZSGHl9uxIUnnmfm5FRCSOw1Xj/LSvbkugmpLqKSO+rVRehy7U/bvxHXM f6EGPE7ZnSMIAV0eDO+DCGqTdW2VBzew1bjHKt125zd+lWQM3DQ6Iu02XxfyYlSS/8lc R7HwC+hFygG/ECC8ikH6pIFCmx557zfLZWTcOZu177CQiv1QTatE7+mBUJWm7PujffSU FyN3GMNRmkcTGEUmtzjxl+EBJ2uxRYX17aeB4KOWxNWmmEQz5PeBR5W50AYL9fmbWZI9 Y0vBXaNQN/dt8lIH54ozPm2eFdOkjWQz5KmLEfZvbNwLktV8ToZc6FoWy4hH83Hgo/6c QfLQ== 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=2MXysM/hMTBAFKZjBf1cYIe3OiZof2SNZO7F3Jiq7Aw=; b=OwB9YZITvHNBDTRbiYPfpJvYlYvizOXKnrWzuvVAKXq0xNJHNFB+oTuO5DENjDESZb dIVwuSgt7SQ2zk38/NPpEP/pp+Ree9GkbzRS8M585k0ADDrSDAdQAv8N+eT+EUvvKeqv Q3H/Xw/wNs5lFbTKI6omIEpRtUONgtt3+6mJfABsEBWWZ+iaJ9t12xnCQoglSnd2IpFH p51wrbQ8xbaQWR9TqEjzAH71rt/mPpqE00GeZcgEFuLk8b7saB0t9p/FK9VlaV6B9ULl 5uoWCzsoBrw25iMaFHOjxqB8BpjdR2VG5gEiM5XD7BU5ym0VOInt7SghyWP28O0YaygB tJqQ== X-Gm-Message-State: AO0yUKXZDIcLXd4iOe4ZDegz/BLiJq+QUypEK5CM5z7KPcxMX7ni8SOZ FUfpw2EdnLXoxfnVuda/wQJrBSmpn4znfgwT X-Received: by 2002:a05:600c:331b:b0:3df:e4b4:de69 with SMTP id q27-20020a05600c331b00b003dfe4b4de69mr250510wmp.27.1676893912035; Mon, 20 Feb 2023 03:51:52 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c4f4400b003e2052bad94sm11464997wmq.33.2023.02.20.03.51.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 7/8] hw/timer/cmsdk-apb-timer: Remove unused 'qdev-properties.h' header Date: Mon, 20 Feb 2023 12:51:13 +0100 Message-Id: <20230220115114.25237-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- include/hw/timer/cmsdk-apb-timer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/timer/cmsdk-apb-timer.h b/include/hw/timer/cmsdk-apb-timer.h index c4c7eae849..2dd615d1be 100644 --- a/include/hw/timer/cmsdk-apb-timer.h +++ b/include/hw/timer/cmsdk-apb-timer.h @@ -12,7 +12,6 @@ #ifndef CMSDK_APB_TIMER_H #define CMSDK_APB_TIMER_H -#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "hw/ptimer.h" #include "hw/clock.h" From patchwork Mon Feb 20 11:51:14 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: 655084 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349399wrc; Mon, 20 Feb 2023 03:53:04 -0800 (PST) X-Google-Smtp-Source: AK7set9tNwjoo+pXPwcdXXZW7XpiJTNHx+Hj8Of+xsDAExEkyyZshGxfZEQbCaJ1+2+VZXr1JiHV X-Received: by 2002:a05:6214:20a9:b0:537:6330:93a6 with SMTP id 9-20020a05621420a900b00537633093a6mr4196575qvd.34.1676893983867; Mon, 20 Feb 2023 03:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893983; cv=none; d=google.com; s=arc-20160816; b=oh+v0H87eFD0H00BKH0dqQA37XgfXsVyMPqcvVAmEwgE2jUCySkU0cTHZ4SyWvFDuC imbH7KhHLBcYSzaOVk0l8W29J8Tzoof4hAQrc96OpVb8dH9hadKljOapvBJ9Viz4wSwx Z3illSuAObTn64HCbxCNnhf5NQNnHie3lxYuVlu0K4tQNMLB/KWmD057hK59jxWJondr l0by6Jc2mBxgDQas1bw5S18m+u8ao0hypsb7MBiiT77T+cgfU6gB1w+Xi6dj6yn8WoxV PbQG6yd44Q4GDSxDNeJsysjYKGZ5Fgn8RIJLH/KdrSU+8VYPRCorizaKV3kaAvXIVO63 ft6Q== 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=74ZBJo9MLan5PaXAa/O0nRsZBEqss8JkgGSoLyAn+kU=; b=LOlkDDKxxw20F0Mw63Z9hydfF0iF52j/gQDn9mL2FRs1S132izasZSJ8M3P95mPrYa gIWt6Q/CBNfwuUnd/DyotIPznPDwrlSsUoFe3B7/if9xdtm3c33NbDi6MAtnyu/oxZl2 eejFtDeQBI8REDe/MVs01nS7VLqUDDnlF96d/kfV/9O9PxHXScMnVZ5ARd2/CWpYGeWy CdHSiyeLoEYey5ljvIJIRqdfaiGoLirR612msvD6Dt51NrvP9MPB91/0Q0lun4ri/tMw NqY9scozCOZMMHHgZdf6FQPR3cE+dw4xSn8c9iSiV4ZLWaK+I3EVH3bX3sAQe7spy1aE r5iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ru+R0vnB; 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 d2-20020a0ce442000000b0053527d7215asi2324690qvm.426.2023.02.20.03.53.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:53:03 -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=ru+R0vnB; 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 1pU4iE-0002Jh-RR; Mon, 20 Feb 2023 06:52:06 -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 1pU4i8-00027C-DA for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:52:00 -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 1pU4i6-0005Dp-IW for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:59 -0500 Received: by mail-wm1-x332.google.com with SMTP id n31so657450wms.2 for ; Mon, 20 Feb 2023 03:51:58 -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=74ZBJo9MLan5PaXAa/O0nRsZBEqss8JkgGSoLyAn+kU=; b=ru+R0vnBsBcT77qvnS3HbagtCp0d513COHI2GV9uR+qZh39ygYBMGtzmPUxbnSFbW9 Rv7V3ES5J0T34/3JxlcIr4svuVVr00jGkGd1nXUooJDHG9cFIdGpwZO9HR4kXWg9LsbJ CiR+V6vgNHv3pLQS01R4vQAPh9bp+baflg6VeJdfQqcjL2z5+3kPPlnJ88CnJpCt3RX/ j2qyGH7mPr3rfBTipOd2yOr8pn9alaIPhXMb6/1uy1rWdtRBRrIcopgSKNjmyPztjItT /D8qkFEDayLIfPCHCzyh1i4ScRB7DZzKMWpWZhcQ2mA+6q4FVCqS+bXEa3GKrEA5aazP iy2A== 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=74ZBJo9MLan5PaXAa/O0nRsZBEqss8JkgGSoLyAn+kU=; b=JfsSD1go0De6zyRcyGMBndT2SdsA8p9MlFR+S+gssstahVkAo8aAwhxYcQx3sz+KUL SB7hYbyDjuHshh7AWHHY9Y9Bipne69mamHYvXATTP8tLAvo051CV3rXUEYk6II2GlVCN PxQyp9emDFmVpguuzGbnyBmWM+bTuOHjHyPPLKsXhVdfeWhH/ADjQVZAMNhEZwfmDoeF CmBbXPffvUWjgzipxg18IBGcxb9i7BeINGOr2/utiwGbpAMIfComoSu4d87fh8YHQ9sf mMXwMcIqSAtPKi/kqPbg34YwFdxQ4Dul/IgS/hTBEYy1LTu3IrXhqttPUuwtmVOc/voo f12w== X-Gm-Message-State: AO0yUKWwxz8NH4TOw8lplJWpGq+lLmelCFGa9QYCimcJbvEp9ntmpXD0 Nr88nwJgWJ9MiHH3uqIBPlvfUtEUrSpV6bVZ X-Received: by 2002:a05:600c:3b95:b0:3db:3e8:feca with SMTP id n21-20020a05600c3b9500b003db03e8fecamr472122wms.15.1676893917095; Mon, 20 Feb 2023 03:51:57 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o2-20020a05600c4fc200b003e2059c7978sm15219215wmq.36.2023.02.20.03.51.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 8/8] hw/intc/armv7m_nvic: Use QOM cast CPU() macro Date: Mon, 20 Feb 2023 12:51:14 +0100 Message-Id: <20230220115114.25237-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-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=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 Avoid accessing 'parent_obj' directly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- hw/intc/armv7m_nvic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 1f7763964c..2fe5b1c4e1 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -584,7 +584,7 @@ static void do_armv7m_nvic_set_pending(void *opaque, int irq, bool secure, * which saves having to have an extra argument is_terminal * that we'd only use in one place. */ - cpu_abort(&s->cpu->parent_obj, + cpu_abort(CPU(s->cpu), "Lockup: can't take terminal derived exception " "(original exception priority %d)\n", s->vectpending_prio); @@ -650,7 +650,7 @@ static void do_armv7m_nvic_set_pending(void *opaque, int irq, bool secure, * Lockup condition due to a guest bug. We don't model * Lockup, so report via cpu_abort() instead. */ - cpu_abort(&s->cpu->parent_obj, + cpu_abort(CPU(s->cpu), "Lockup: can't escalate %d to HardFault " "(current priority %d)\n", irq, running); } @@ -749,7 +749,7 @@ void armv7m_nvic_set_pending_lazyfp(void *opaque, int irq, bool secure) * We want to escalate to HardFault but the context the * FP state belongs to prevents the exception pre-empting. */ - cpu_abort(&s->cpu->parent_obj, + cpu_abort(CPU(s->cpu), "Lockup: can't escalate to HardFault during " "lazy FP register stacking\n"); }