From patchwork Thu Jun 1 09:46:19 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: 687700 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239895wru; Thu, 1 Jun 2023 02:48:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Kz/g/dJsAZgyvGiDutAoO390Hz95mqMlvQrEo4GE8WAPncTnf1fVOdUJ+XSm4119EvlEh X-Received: by 2002:ae9:e80a:0:b0:75b:23a0:dec2 with SMTP id a10-20020ae9e80a000000b0075b23a0dec2mr8492450qkg.64.1685612911601; Thu, 01 Jun 2023 02:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612911; cv=none; d=google.com; s=arc-20160816; b=ew5GffSh+LbGQnMJKfJKgSYypiKNUKdh+Fby/6zz+5s6MoXLEIOAoAGQ3dfLaE3wx5 jTALcQIj8+MK7xAtxLkq+S43Eq822ZYwdV+DkyNtorjtrmoJYz7U2Mbaue68WRdFDcw4 Pncl93N5mJ9N0/45VSyWRhUGT1+pHm/i1+USiH1LEo79/I0zchHPKW/ahjGZ5M3RRI0b cnI0YizxVMMKrAWaOPJ4rMp8c8Rft9LQavgRr1dguPpN6Mv0u9pQEooLiQNJJkQrDM6y pvKi5GN3VU3pAUGADJorulHkDhzxuy5Q5gXZL5sqQVYPFwWVkmdBRiDAjGl/mOAo7NW/ oMmw== 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=vY/PoCZ3Ec5EYMAMd5EtE2RxWZcVnX6V92z8a0JGnWI=; b=TPPkLLOWrIr2hj6xxMbqPtggHrYnjYi2ZovNzQHDST/OaYeXeIiOHqrSZjhmnnD/12 c5delbmh9SVzs7CxmSx4WGHkTI7UZx2+GLr1H3qiWqgMJSX3R4HKem0l6icvTsi0vpSe UaaibE68NprZ1RFZ2MbvI1fJcMom48qhOq98Nm2tGCGz83mzLfR9G+7SaCsI/oqhEuSS 0uNYIdqFYkYAh/3V0HE/RdGsPI//svUMksYPu3alEtpnkPQfDC+iltTQv8pNQ0xmLGF/ cXRbPQCmye1xFAp3/JZGlar/mGEHFl6nR7vt6bYhduKGKtLlEwfLNGm6XH5bLEO+xsZ2 +e1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xbOS1AhF; 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 p2-20020a05620a132200b0075cd9ae4af9si6986156qkj.118.2023.06.01.02.48.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:48:31 -0700 (PDT) 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=xbOS1AhF; 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 1q4etD-0004hk-0r; Thu, 01 Jun 2023 05:46:39 -0400 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 1q4etB-0004h7-Oa for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:37 -0400 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 1q4et9-0004Bd-Dw for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f606912ebaso6755995e9.3 for ; Thu, 01 Jun 2023 02:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612794; x=1688204794; 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=vY/PoCZ3Ec5EYMAMd5EtE2RxWZcVnX6V92z8a0JGnWI=; b=xbOS1AhFoorwp4b4xkMClFMty4NklH1wCrWv+kCAtiFdYRyn8TNuqgfafNInrS8SGp M0ia6xiUYJK6sOQAPUc5ayfUtQcTOUsVWIA7eIKxtS+F/HIIVTkuZsBfJFimOY6OQAxv Mew98DkL9m/WUK/r+SoOfCygw6IUUONs+tXAcl64BGwOgFb2lCyWzRUhKdP8FRTxE7B3 yMzG4bUosPDD+vEo+x4U1It4gHn81ZJseCqG0Po7ne65TuR80CcIEDpJ9Z4Z5NYTGqs9 r9Y0aiFPx+mPbT0TEhoKO+CDvl4OMh2ZgWh4tsbDLQOg6tEPj/4IBjxpElfSegibSk68 j4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612794; x=1688204794; 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=vY/PoCZ3Ec5EYMAMd5EtE2RxWZcVnX6V92z8a0JGnWI=; b=lORIO2BkSjxzZxAtrCyAoGBg2K3AS4JRWI0XwyZ4qiIyCygm4u4H9bxnMOM9CApemZ q+zJ87PJeYFIuGYRDmHY6qVXlwDcDcLATFpJsNRPt/gtPYCUcgqUc7emGWw3E8noc8ts euLIMO9c20C9xMJHsAJZe7BuDa3gbtdyNUQThjALNuKwhddY+l7VJtyE9qosRbCoUi14 o8dZaewEfJJ6ZPLc0C7EvBoMwmiZfEI3CE6wsvXIhqC0N1rOv9chQGVIhNXJHUTfDfHd B597titCN318mNQrBc42P+FsD+N8HhuN9PBeGOZsUEdip7HNDIBmyGd+c2LhPmakr6R0 fncA== X-Gm-Message-State: AC+VfDx8v633NUfb9eny4UeJrqIoc//pnBkJR9/jnDBIPoLYTapYLpdZ EN/1Tp5dH/urL+K6+c3nG67MwPtUPnlsaum/dvU= X-Received: by 2002:a7b:cd15:0:b0:3f4:21ff:b91f with SMTP id f21-20020a7bcd15000000b003f421ffb91fmr1305050wmj.28.1685612793736; Thu, 01 Jun 2023 02:46:33 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id k7-20020a05600c0b4700b003f4f89bc48dsm1709017wmr.15.2023.06.01.02.46.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:46:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 1/7] hw/arm/xlnx-versal: Do not open-code sysbus_connect_irq() Date: Thu, 1 Jun 2023 11:46:19 +0200 Message-Id: <20230601094625.39569-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-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, T_SCC_BODY_TEXT_LINE=-0.01 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 The SYSBUS_DEVICE_GPIO_IRQ definition should be internal to the SysBus API. Here we simply open-coded sysbus_connect_irq(). Replace to use the proper API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/xlnx-versal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index db1e0dee6e..79133afa71 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -704,9 +704,7 @@ static void versal_unimp(Versal *s) gpio_in); gpio_in = qdev_get_gpio_in_named(DEVICE(s), "irq-parity-imr-dummy", 0); - qdev_connect_gpio_out_named(DEVICE(&s->pmc.iou.slcr), - SYSBUS_DEVICE_GPIO_IRQ, 0, - gpio_in); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->pmc.iou.slcr), 0, gpio_in); } static void versal_realize(DeviceState *dev, Error **errp) From patchwork Thu Jun 1 09:46:20 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: 687695 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239474wru; Thu, 1 Jun 2023 02:47:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mm6y0/NZSadEA+DnOqhXiwlaL89ucrGY0cNIyd/Rfsfq/9ArJr8eHKlv6hJkMefSMpbzn X-Received: by 2002:a05:622a:48d:b0:3f6:c46a:79c3 with SMTP id p13-20020a05622a048d00b003f6c46a79c3mr9749414qtx.52.1685612841351; Thu, 01 Jun 2023 02:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612841; cv=none; d=google.com; s=arc-20160816; b=Up104Tf6oz5ahBRHYSXR3tI7sJvufnUXABXfqD5vnf98FH3QU3vqhNmT1jAdeAd7XM Y+fnv1N2kmg4nsr4lVuBKRVfNSk76AwsG0F0i02vi8CNcVzsO9yRlQAIZFu7Qzn0zFHI LHBBOL/xtQah9z764kUZN3AKoHiTVmcNyZvVgpdTu+e9p6noKvp9K6FVwvUhYFOd0rdk hrBNwOMKSg46/JsqW7EsFlu1ZPYF2Oaq5gy4Opw5JzOyBRYM/Hpm4JnS3hMrPioF5xOy a/YrAmKglGu7IO4Y/jch04plkogx3yQHO4h+aj0zzlZIAdvXQI79vEbIQeT8dYnp/yDD WcpQ== 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=ufm+WJCjG6m94oCrL/5Ldv1CVPJfrGDblHgEVPADtVU=; b=upfCsKZqmRf4KW2ubCJn94NcY6pSS0wnsYtYNNZUDtIlTFx0+cnashi4vKpzao2xh1 ZJszg/kRKypZVWCJSDEjvFkpIVPUNaBEI+qnvM1FqELOZ9ACVDbg+NGZKzw/scDOJPwn GgUcyRnZU1VFQW5ajR76/htznWg8TTMwjU75+m8yhxDlCM3EulII47jVOL0mD8ZiZnNs 1RUnPZKxBWTnzOfrxflCUhEg+JkUR4S73FRMA5fUHr3l1MAJg3zmhsoOau0ds9WtBTt9 ccABqdew3HUoatZiBfT6dQaS7X28loLf43zGt3sheJQCNrhyCBLA3ow4HxLX38KwVZaq Pr0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z6E514Ta; 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 l12-20020a05622a174c00b003f389d7996esi9534110qtk.605.2023.06.01.02.47.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:47:21 -0700 (PDT) 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=Z6E514Ta; 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 1q4etJ-0004kH-L2; Thu, 01 Jun 2023 05:46:45 -0400 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 1q4etH-0004jJ-FC for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:43 -0400 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 1q4etE-0004CV-Tg for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:43 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-309382efe13so642175f8f.2 for ; Thu, 01 Jun 2023 02:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612799; x=1688204799; 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=ufm+WJCjG6m94oCrL/5Ldv1CVPJfrGDblHgEVPADtVU=; b=Z6E514TaBtii7SkwlCbxbvcqAA9FCT2ZS0eOX/DqTzYlpIKLG3PNA/cYdYKHUecCQb wqWof+8gR31KLmgMPRLy9ZhyoN4zcf/wnvNYyeN0YMKqB1Aw5NqjKbiXSOQBS+RdhFMX 7Go/8BJZ0FQKI56FClS1WLI/V+6nm6sZErIPwWEsZTNzihV2KyHdlMwJzCuIKSTnfWDQ 3Uo1uRtaN8OkyLhTfk3N3FFrIjfM2YVf8x3d6xXniLKpPJgTQ25KdhjXpJrIvB+j45nz KkFCT6iZuX0Zoblbb5Anc+FlDw1dVoJdHLRnLG0ucQnu7PyOXjytjxvq7cqEBdg7tX/G jYOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612799; x=1688204799; 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=ufm+WJCjG6m94oCrL/5Ldv1CVPJfrGDblHgEVPADtVU=; b=VlGj6qZfjwxkLG3w05leSLLh/PkIAjAPdNNuCa/c2VqR30Tu+QJhcLC4LxVVtz8uSi IAqPJCMpauWNOa1kKcYF9oj3PFE5S2RmJbhbgvbMS4SUEo9eVLwTQZ7gPg6HxuhIlOew mfMRJZGVCZV3IijBXSlcUORDAD2SEC81F9qnY1cPvty9ekNq8DPPp1ZNzjf0Ft6A/lej ChF4OMS7pvEFPSN+K2dSfy2XcM8lNqfvxQvV56cWdXlAXIw2N8CYIOpyyO0RI+2Ls7wW CtM1jUVrS3tf961te5XD7ZrNJiF9p2cY9Q8CeZ5uqgy9WLd6aMdzlnC1/+l74v2hXCz0 JsLw== X-Gm-Message-State: AC+VfDy947TGE7js/yJYGf7DK7vWL9+QfRZQWqoEZW15J1zCyMwoSD3R ulov4VMoK7ij/mencwMciNLpRoCxIU7keVd5WLE= X-Received: by 2002:adf:e3c8:0:b0:30a:e643:2517 with SMTP id k8-20020adfe3c8000000b0030ae6432517mr1408660wrm.21.1685612799115; Thu, 01 Jun 2023 02:46:39 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id l13-20020adff48d000000b003064088a94fsm9659338wro.16.2023.06.01.02.46.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:46:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 2/7] hw/usb/xlnx: Do not open-code sysbus_pass_irq() Date: Thu, 1 Jun 2023 11:46:20 +0200 Message-Id: <20230601094625.39569-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-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, T_SCC_BODY_TEXT_LINE=-0.01 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 The SYSBUS_DEVICE_GPIO_IRQ definition should be internal to the SysBus API. Here we simply open-coded sysbus_pass_irq(). Replace to use the proper API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/usb/xlnx-usb-subsystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/xlnx-usb-subsystem.c b/hw/usb/xlnx-usb-subsystem.c index d8deeb6ced..462ce6c3ff 100644 --- a/hw/usb/xlnx-usb-subsystem.c +++ b/hw/usb/xlnx-usb-subsystem.c @@ -49,7 +49,7 @@ static void versal_usb2_realize(DeviceState *dev, Error **errp) } sysbus_init_mmio(sbd, &s->dwc3_mr); sysbus_init_mmio(sbd, &s->usb2Ctrl_mr); - qdev_pass_gpios(DEVICE(&s->dwc3.sysbus_xhci), dev, SYSBUS_DEVICE_GPIO_IRQ); + sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->dwc3.sysbus_xhci)); } static void versal_usb2_init(Object *obj) From patchwork Thu Jun 1 09:46:21 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: 687698 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239851wru; Thu, 1 Jun 2023 02:48:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6OpaAVT4EqG/PNcKqFtztvValzAAUQ/TWjOQosye+3BYQx/nqTP55/RrdrZTiUphzxDKBD X-Received: by 2002:a05:620a:8ac4:b0:75b:23a0:d9ba with SMTP id qv4-20020a05620a8ac400b0075b23a0d9bamr6893520qkn.16.1685612902378; Thu, 01 Jun 2023 02:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612902; cv=none; d=google.com; s=arc-20160816; b=Jh2oNnYKEr8sJe9Ciu8UBKZEQj4UO7lCWhoJUZ8W5jH+IDbNY2ItGRE997sQ1n0msj rcQEDLmOxxuVVKiqAz9+K9YJ08hjIG9Ny/55l5gavzM9jhq02ID3wkipRrVC3/tS3cDw 281E5WstRJBMKj4CWGsPIqeHs4Cxx3vw3qavjj/8CcJNgmG3NvZDLlhHn8NEEeJo+Kpp 8F4//z3sj/DyIEgP6XdJHcGornTdGh+1YBod7rWPKiMW+sjL8m10/SYwNZaUk4XMGNQi z7N1/fL9y2blHTPjsRHGtw+tRilvu84AVPlXfBxLbbq23TOiKCQUWSHNQklQKy5jwJat 1G9Q== 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=1Fxf+SZnw4PIJBwyheZ5LFEtj2ykqgNetOmC+XmhM6A=; b=FaELOumxftAqjrbogrTWOnOYYOFOdDnNLjMhElbmUIOOE50Iiw4s/kyws1zXb6r2Qn UP0pkp54xQnunilh5puELhELaTT5NQd8FIjFAznU/QvL+kMQ286+RdGcrRIoaUjVmAbt jCh1f2O+EvB9MN+mh5dnBUpxWtdzxZuQtczZRwm4SkDhFsqkLoRpnvFDsWABcG6hTL3D DHUqYjGcIhPXUBvxyqPA5CMylVJ2c6YJdC0CG6vQY0E/czACwy8wErLUc/D7dMU0t5VA oWmpabjyxZFtkeKcv68xZzEYWg2WMNqsVLoJ/jQwyk0nu4feTcwX/VVrDJNf7TWIfRLo nxpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YlBTXBwn; 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 c9-20020ae9e209000000b007595c2bb085si5350199qkc.259.2023.06.01.02.48.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:48:22 -0700 (PDT) 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=YlBTXBwn; 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 1q4etQ-0004lx-Rh; Thu, 01 Jun 2023 05:46:52 -0400 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 1q4etM-0004l9-VK for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:48 -0400 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 1q4etK-0004F3-7e for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:48 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f60e536250so14560315e9.1 for ; Thu, 01 Jun 2023 02:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612804; x=1688204804; 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=1Fxf+SZnw4PIJBwyheZ5LFEtj2ykqgNetOmC+XmhM6A=; b=YlBTXBwnaD/PIPk9893Cv4vi/8MuzsGTK0l1d4NvZS5Gtdp/Zt8GhJHNAo82MwtVZJ BGNxauwXMiPzWYds4g/HuWfJTb8+pwugxMCv/FrKMi34u8J2KtucLxiNols5fOUcRFrs jUEBChfTzNXbeDbQQ84evcqg//XLqIL223TzqsoZH8JrNikyp3VjjyBgV23dfN45bZWI qX+1As9DM2Vu7HtCWqb2v/altGVauCsV3Yg/mmLep8iMMPzubFKjjjaHZkiWgQVdHYBh 2slE0xeYpa/QalGpUZYdOYw7pH66f+BYdaOyy/SLTc6tdxL8HTK5bABCXxM4c5Pho6Nv j3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612804; x=1688204804; 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=1Fxf+SZnw4PIJBwyheZ5LFEtj2ykqgNetOmC+XmhM6A=; b=PlGvlVe0Uw3Tdo094qM2eesZcVhPYnIQJ6I4K860mFl+VLOIl65XuSz3MEknHstylB wPCLwcjB78IdU2CiyxS7hIfMPGoc/CMAmg46xFuY68F7eqwR5Cyn/mNvBPW+6DeJRA24 QdzD2gAnULZJxP3g+6enb5X0i9Ff+BV9+KyqGU01u8B0cNGVkFGVFua5JUu07P6i+pgU 0BLgJxaCYNKleX0TIkMc8RPiH5rZ8vw81dc7oQzrQygU9QYekahKEilpmR2zqhGe0d6n +XQKDomB861OwZKAYAjc4xwfzIYYJlP4XL4FCOfZ2dm8HDOW9/av6FmOnAX6Akw6dMx6 Ee3g== X-Gm-Message-State: AC+VfDysl4WpMJ9DjoiG/HjLv4LactCyccGp4Kvy30vt0ED0mATSy2La G65K5TDfiHk4lq7W5BQrzHHCJ2KsJKsF9qLgJCk= X-Received: by 2002:a05:600c:15d4:b0:3f6:117c:b8a1 with SMTP id v20-20020a05600c15d400b003f6117cb8a1mr1149973wmf.6.1685612804581; Thu, 01 Jun 2023 02:46:44 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id c15-20020a7bc00f000000b003f4fffccd73sm1724741wmb.9.2023.06.01.02.46.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:46:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 3/7] hw/sysbus: Introduce sysbus_init_irqs() Date: Thu, 1 Jun 2023 11:46:21 +0200 Message-Id: <20230601094625.39569-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-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, T_SCC_BODY_TEXT_LINE=-0.01 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 The SysBus API currently only provides a method to initialize a single IRQ: sysbus_init_irq(). When we want to initialize multiple SysBus IRQs, we have to call this function multiple times. In order to allow further simplifications, introduce the sysbus_init_irqs() method. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/sysbus.h | 1 + hw/core/sysbus.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3564b7b6a2..bc174b2dc3 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -70,6 +70,7 @@ typedef void FindSysbusDeviceFunc(SysBusDevice *sbdev, void *opaque); void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory); MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n); void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p); +void sysbus_init_irqs(SysBusDevice *dev, qemu_irq *p, unsigned count); void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target); void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size); diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 35f902b582..a1b4c362c9 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -175,10 +175,15 @@ void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, sysbus_mmio_map_common(dev, n, addr, true, priority); } +void sysbus_init_irqs(SysBusDevice *dev, qemu_irq *p, unsigned count) +{ + qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, count); +} + /* Request an IRQ source. The actual IRQ object may be populated later. */ void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p) { - qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1); + sysbus_init_irqs(dev, p, 1); } /* Pass IRQs from a target device. */ From patchwork Thu Jun 1 09:46:22 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: 687697 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239686wru; Thu, 1 Jun 2023 02:47:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5FIiAscSmWOsObApJmKxC0wH8724pKP3aeD4YWo2q/cBOWi23C5wh7HPoIAu0Y2XTjjme6 X-Received: by 2002:a05:620a:8c4:b0:75b:3845:2297 with SMTP id z4-20020a05620a08c400b0075b38452297mr1069995qkz.36.1685612876067; Thu, 01 Jun 2023 02:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612876; cv=none; d=google.com; s=arc-20160816; b=meRomyxi1pedWNFuWhZB1ZRuTU0rgMsqw7lyK9fOJW6NRZs6BX3W0307IC2baVnwXT Xd3oKcnVvhEwzZP1zZj/EJ1uIrn6T6b0D7htD5efLwVvkVzrUJGuMbbeTr7HK+jxGsP6 n0YuyxB7hMcHxsf1WVoe0ssRhi7ccRhw4wASrI0anPqc3ezORBw8TLJlHyCptDfcBpdP 0QZqYtwmr9rdxxwDupcRO9FJfdsaQIhRfG82KmEQXs2+GkK98oxeVLLCfPJAm6j/ZRB6 h75SCDCl1hIaDdeUS9yW94LX3nGaQo9L59wIWNlj0JsTu3ly+iqtwQPsB5Tt5FpuzTYV ZWsA== 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=ytKJ4206h8h9MIhh3K2ca9hAIyIqwQjtRMy0/wxoB3g=; b=RMjMK4cOxBXe0dN3XdOZsMzRQeXQHaei8ww2mwiGEoYjnsrcrmFONhLZLrIev9uR/n 66mACCNgMZSJLddVTeHs+TVgGOV2wyQaJWdPVFgtbRB1QDps2D0YZM/UpvMxr7JfmPBj ClatYWyootOMMIbF7IfLEQHVrNvEfkCvZ+y/33xEX/aafHzRFcoK6fgf2Ct6vndu6e7h VO2UPSRXCIp5fvLVnEY6njays51AYfrmShTPnFKUV5qt20AsFYkx0A2GM32f//mD62HW PYertWD5wi/rNcTXtpXn1sN4594ADYB9ryiBFAjtNQSs0RxWSxmtEerTvSe/5WTgn7/Z jNRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wg47OOV5; 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 o23-20020a05620a15d700b0071d5008ce4esi9129846qkm.210.2023.06.01.02.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:47:56 -0700 (PDT) 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=wg47OOV5; 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 1q4etj-00059O-Ej; Thu, 01 Jun 2023 05:47:11 -0400 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 1q4etX-0004sQ-Dw for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4etQ-0004IU-QM for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:58 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30ae901a9ffso574333f8f.2 for ; Thu, 01 Jun 2023 02:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612810; x=1688204810; 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=ytKJ4206h8h9MIhh3K2ca9hAIyIqwQjtRMy0/wxoB3g=; b=wg47OOV5b8F3NyTo4A43okoBT+ngjyaXy1BoODOnpRuXOZtaajxJvbn7NYLBxnQVFe E+C1LPP2ZezHhVFA9xFI2HwjPtDVaQBwwYKkt4CTCespHOjh4LDTGph8JrIbbbnorKDb UtOh6mdvIcayOJgu5HCgZYXIhqJRUSXq/LAvbvPWOx2govt+SLKn0WMd4mZ2oIF9s6FU YaFvqpla/jd3yGWRGCTiw3TH58bEWAkcqyhzrm+zhXWh0t2SnRXUtHSl+pOA6rs3j8Hp 0v+kFVeTenKezV4fOo1285/Ovq8r7angbnzq7rS1FVf3F/RR33XiuZ6I+tyw0ExTbVb3 eISw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612810; x=1688204810; 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=ytKJ4206h8h9MIhh3K2ca9hAIyIqwQjtRMy0/wxoB3g=; b=ULTfdQM7zPxJ3yK5ozXsxHvWvRjpXTmNbzWnKPtIkg07bACZzweRpOKVvQ+xcnzA5E 6poGwluFbYQPqE4yGEsKhs4fHBukNWJQd9TyOMZ3UCgoYcnOUH8xSySyPn+KZG/Aj25c xzeM0ohM+qa+wKKbfBHfPiSeHLercjY197l3GFLdGxIhirDX2wnpm+cx4UNQfQYBQs1b CdcZmyDaTkrkaD3150rEQkj2tihpCeiacWYdMo4oOJbY17pRvy+428ofAA3xFPIfiYMI sY0WA0kuzZ+P1882VBpeTTfyBYSEMUKd27l1gJy/YnVx51oJcpHi/3BeLxyoiLHjd15Q Vxpw== X-Gm-Message-State: AC+VfDzXDqcBISgbDyoprHgztIH9OsiNdQ5sO9EFjBCRo/eIQxlFGTTX /n6uD3+8/iYWvNLSuZDvhn7Z78pDtjkytDdwpGU= X-Received: by 2002:a5d:4249:0:b0:309:3bb5:7968 with SMTP id s9-20020a5d4249000000b003093bb57968mr1504958wrr.16.1685612810153; Thu, 01 Jun 2023 02:46:50 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id o13-20020a5d474d000000b0030af54c5f33sm8276554wrs.113.2023.06.01.02.46.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:46:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 4/7] hw/usb/hcd-xhci: Use sysbus_init_irqs() Date: Thu, 1 Jun 2023 11:46:22 +0200 Message-Id: <20230601094625.39569-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 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 The SYSBUS_DEVICE_GPIO_IRQ definition should be internal to the SysBus API. Use the recently introduced sysbus_init_irqs() method to avoid using this internal definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/usb/hcd-xhci-sysbus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c index faf57b4797..e512849b34 100644 --- a/hw/usb/hcd-xhci-sysbus.c +++ b/hw/usb/hcd-xhci-sysbus.c @@ -40,9 +40,6 @@ static void xhci_sysbus_realize(DeviceState *dev, Error **errp) if (!qdev_realize(DEVICE(&s->xhci), NULL, errp)) { return; } - s->irq = g_new0(qemu_irq, s->xhci.numintrs); - qdev_init_gpio_out_named(dev, s->irq, SYSBUS_DEVICE_GPIO_IRQ, - s->xhci.numintrs); if (s->xhci.dma_mr) { s->xhci.as = g_malloc0(sizeof(AddressSpace)); address_space_init(s->xhci.as, s->xhci.dma_mr, NULL); @@ -50,6 +47,8 @@ static void xhci_sysbus_realize(DeviceState *dev, Error **errp) s->xhci.as = &address_space_memory; } + s->irq = g_new0(qemu_irq, s->xhci.numintrs); + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, s->xhci.numintrs); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->xhci.mem); } From patchwork Thu Jun 1 09:46:23 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: 687696 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239495wru; Thu, 1 Jun 2023 02:47:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RfH7tUsZZvBHFs3bhG18fFAkuiR/jEsdrHyoaoN37WVg0UJzp9ly7GUhyuLqde3rfMY4e X-Received: by 2002:ac8:5a8e:0:b0:3f4:ec9f:95e4 with SMTP id c14-20020ac85a8e000000b003f4ec9f95e4mr1034071qtc.6.1685612845153; Thu, 01 Jun 2023 02:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612845; cv=none; d=google.com; s=arc-20160816; b=mVs9MtzqhSoN/VX2iGw9aannwb9UtQW9Xs842xXkuyzhP9RiUSJcaU/Zj6y2dqm6aW mKgUpSaLMc39bblZvYeITlyG3dmJqnxc364ey8TXJafS6At/RUeDos5GbTDriOdJ2g89 alUawNaRGc9rV8q1dVuQZ+jzgVlHgat9Xn42w7v/6T5vgVGzeh/4fBUq09T1NvmUu8v8 1sxzm/5ZuqRGGlEWGYdhezbEtu/KiRBiTErodUeqJXHnMjvvzQk2gc4vyLiTSSjgHM51 QlmCLuRQlUX0Idz3+pWqB0sO26nGXEYwOgaMuEMQ66sAJQf0Q9KlYzrhufCaCM7Y9w/5 Epww== 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=RYVCBEhA1iXQ5tL/suTEeLd5NADdFT/NM2XcFcptWG4=; b=P9LpK5ZidHsBCSyONeFYMVBSCvQASc/SZtWRxSdySafIQBH6q7WILAuIIQUl7QunSp /9rTiWSbNFLmyM5xpTLB+9I0epbuSD492qN7AWUWU5v4akSyg8q8CdGr2FsWwo5lJVID EgsZQLuDw1BzoLdQoJNODaA61Isu0ME5+Mbav/iSE6QFc/sfbHWRa327XgvUoVQFt1uD 8EYInztjNB7Tlwuh1/+Kpyn+F3vzuL1ibRzxMKxr+z+ikIOIreGQoUmBu+Bo0Ghl8Ixc adUvf4LSQr/5FAGXzYHszNn2Jg52nnIv2JU3IWItb/qxTWr2E7EV2nqPNcBHjuARUbsz EObg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j2K14w8V; 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 v17-20020a05622a131100b003f4fe39f76bsi9350304qtk.83.2023.06.01.02.47.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:47:25 -0700 (PDT) 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=j2K14w8V; 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 1q4etd-00050d-Cj; Thu, 01 Jun 2023 05:47:07 -0400 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 1q4etX-0004sR-EJ for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:00 -0400 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 1q4etV-0004Kp-4h for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:46:58 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f60804faf4so6042285e9.3 for ; Thu, 01 Jun 2023 02:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612815; x=1688204815; 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=RYVCBEhA1iXQ5tL/suTEeLd5NADdFT/NM2XcFcptWG4=; b=j2K14w8VbPOtHENin/CDLGNvJAyQAvBSboBXMlWdiRU0+5ItuT6cg4CrGcxC8QpHOf 83h+F7wa/9Ssbe0l+PqpXho6YfJm3qUvdr1Ce8AlwWkA2NlxQfKiJiy0l8CvKvJxyePP ThYEMCi5w3UgiEUc5iQVMncMOZCNOFJy45aZFk3N4JKfNXQ3cwEtzZf5kIQTUSd1XAs3 +2ERdKEA86B9QfmpKNaNKW8JJPJzBQ4FGUqrW+f3qrNgwEpZYiqOFI6tT0kmZa/JXVpb v9Z24uIJbzmYqHkgz/xojtZlFx4loqpkp71Z5k5bkCXrzx4i0Myy7QMWZSnIFrYnca9P pM8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612815; x=1688204815; 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=RYVCBEhA1iXQ5tL/suTEeLd5NADdFT/NM2XcFcptWG4=; b=QTrxtSZdfiISZVv9cl+9Iok7E1GpgMRIKOGJuu0LrnefaKfRKa7qAJz1H8CPkZUdcQ IMqmYvkXXv5n4gX2ZKHOa94N2JGjbw9gEqrSnK0E3Mp7J0/WV5jNVVCCCe91BGZNSpqU X6vlzuEBM0+vh31TKKRdHwbhQN04eOQX1FG18WUoYd7zd+TEDKvFu6ZrhUDomp+CC+oh vu6amlq/3CBKSbpD3iED9+2iHWrTLgqNLB3LdNuxM2L19vTzUy0UVMM4wHHwDlwk5Yqx S6MOo7X1UWdWpXaJydAf5ni3mz4p7+oTVCAx06R/genyRgF6ng3wCMnB4ubRSTifMe+e xImw== X-Gm-Message-State: AC+VfDxsatGZm4C5+rH/WFIq11koO6K9KdRsbJRS/rVY6P76MAmo2rEw nyMmDJrl+CNNkrfjBeWKv0uAJT8Y6pzg8aXgjB4= X-Received: by 2002:a7b:c5c9:0:b0:3f6:683:628b with SMTP id n9-20020a7bc5c9000000b003f60683628bmr1764527wmk.3.1685612815467; Thu, 01 Jun 2023 02:46:55 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id v6-20020a05600c214600b003f607875e5csm1685600wml.24.2023.06.01.02.46.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:46:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 5/7] hw/sysbus: Make SYSBUS_DEVICE_GPIO_IRQ API internal Date: Thu, 1 Jun 2023 11:46:23 +0200 Message-Id: <20230601094625.39569-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-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, T_SCC_BODY_TEXT_LINE=-0.01 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 we don't have any use of the SYSBUS_DEVICE_GPIO_IRQ definition outside of sysbus.c, we can reduce its scope, making it internal to the API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/sysbus.h | 2 -- hw/core/sysbus.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index bc174b2dc3..cdd83c555e 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -26,8 +26,6 @@ OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass, * classes overriding it are not required to invoke its implementation. */ -#define SYSBUS_DEVICE_GPIO_IRQ "sysbus-irq" - struct SysBusDeviceClass { /*< private >*/ DeviceClass parent_class; diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index a1b4c362c9..f0ba57dcbf 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -24,6 +24,8 @@ #include "monitor/monitor.h" #include "exec/address-spaces.h" +#define SYSBUS_DEVICE_GPIO_IRQ "sysbus-irq" + static void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *sysbus_get_fw_dev_path(DeviceState *dev); From patchwork Thu Jun 1 09:46:24 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: 687699 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239880wru; Thu, 1 Jun 2023 02:48:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nQntFVoN3WaVBcwTRcVtcpPPjmDITuNayLfPahp6GvnUYJ32ah7FZ3urXonvSrolGzK1c X-Received: by 2002:ac8:5981:0:b0:3f6:9fde:bc89 with SMTP id e1-20020ac85981000000b003f69fdebc89mr9445233qte.65.1685612907836; Thu, 01 Jun 2023 02:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612907; cv=none; d=google.com; s=arc-20160816; b=mGpavYJR0JbgxRaAsX7mjTPpLLTmka7/kCjv98XxET8WZh1YzWopbU8hZjOy6zZXHA 7Mw9SHVGA6jIj0Y1R+00lIpZvi6njjgN50jilcnnXN+w9SRXOIcZB6m1lUFBx1i0mCiD FuyneYLww5kvOyqRwA6rz9/xy7pp/WNseLiVpBctmmxNPVucLd6wUbZPcH7VNvzI9INA Hs0ccoy9AUsf6Pi5KEqxsTZkR/vpXR5Y5+0pehI5u1JqriqOxAa9rzm9ifxQ/eG3EdJX LlVpgLewr372uotLT3zJVxNSGdwN7iILjMUIv+WwYoaNTHRL7Kv28kH3CRR8lZ8MWX2j erxQ== 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=L9AD+H5wegdnmfNEkj08F2VlNYed+k8ihUVP6V8RtCY=; b=zEpwsge3DmFNKJT4PKLbg4EjvbwmoFCv4umjX8EaWvk1EuzD0XNtmbnjo75fEiC+dW CA9SnXiWw9cFyIsxg0dkq4Y+aWR56OOnijPzoDwCqzcL1BM0XLaq4GJOJPS4sNE4TwOS J8RjI+o28AGfK9y2bcmECWSrYi0dysiyDpJrxCdgSUTxbO6cNwmRaDWiqJLaRe47VzlB AyGvq5qOtn45c5j/h13J/99l3eYlTkYM/xiEqQMvaK15SAMPsklOJXYI0zcXnpmzTq04 nHi5GvqgPxvVz1R056eaRnxUtxd1Eg0enMpgb6HuiPpu2MCoaROMzVxhpCZWTWLQO3CU zS2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wdIIT1Bp; 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 k7-20020ac85fc7000000b003f51f102527si9828049qta.760.2023.06.01.02.48.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:48:27 -0700 (PDT) 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=wdIIT1Bp; 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 1q4etk-0005Ae-40; Thu, 01 Jun 2023 05:47:12 -0400 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 1q4etf-00054K-HQ for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4etb-0004MH-13 for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:07 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f6da07ff00so6782435e9.3 for ; Thu, 01 Jun 2023 02:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612821; x=1688204821; 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=L9AD+H5wegdnmfNEkj08F2VlNYed+k8ihUVP6V8RtCY=; b=wdIIT1BpgHociEIkOqUv58wKtGlvR3R9mL9wEtOarKRwFXRjOe10OP/kVgrRDvoq5F 3OThZSUrvL/+FzQ+MhfB+A7ojAQuzO7Js9fKfEHJuK9XOLVfxTeOipdkKufD2UzZoBrz AMeQF284LZknCwgc7MlqUq/0FtID56AqNOI3lPnYV42Z7Xi3F6ofCnZJgPBFvpxqybPw 8LwBJ6ux6UvTgzrfI7ryvLXBha7gH6AxGN1n+GwGajnvmesvuuazBnMI8U3pMiIE55oo 857HA2jEgjXkO8F7Hp9P9n8Iju3tadTfWl0XuVSqQpMI90vDSpMyy5du+Ims4giw4Dn1 46aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612821; x=1688204821; 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=L9AD+H5wegdnmfNEkj08F2VlNYed+k8ihUVP6V8RtCY=; b=e0S1udLg2NJAAaqdcQqZe6rRAE+T2r0k51KgkpF3V2EqksKzudXufdg/aqmmwQ1SAO mbYtQ9jCDwSi55oYMP14MMmTjEaYQeFwpY5veBaCuxQ8VmxANYGxAnlKMMWt5kvDKl+b By5iNzmktSs709uNAFuO+An31H8j/V4G9dmZRawXgwMjGw1N1W/DEV/1QEeWgbufHNpL vEHBhDNaFGsaUAsFg251pM+28iA0E3s97/tmESu4FwizwyiUTnavQJwcQyFo38woixU1 Etjij/CNxyrA5KwuR0xHjcXXIFGIHiR8VgkAA+4n4xYzhEL/8d3pPrMc2vBef98sU6uR UX7g== X-Gm-Message-State: AC+VfDyKcwR8p4Vs/N6HbhcO5pOkLcObxRpYTIwEdszYM5zmD7krIc+n NZoDKOVNTbZxiPlZMij6+qRS+n4dUF+aH4X4D9g= X-Received: by 2002:a7b:cb9a:0:b0:3f6:42e:579d with SMTP id m26-20020a7bcb9a000000b003f6042e579dmr1982351wmi.27.1685612821030; Thu, 01 Jun 2023 02:47:01 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id i10-20020a05600c290a00b003f0aefcc457sm1687821wmd.45.2023.06.01.02.46.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:47:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 6/7] hw: Simplify using sysbus_init_irqs() [automatic] Date: Thu, 1 Jun 2023 11:46:24 +0200 Message-Id: <20230601094625.39569-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Change created mechanically using the following coccinelle semantic patch: @@ expression array; identifier i; expression sbd, count; @@ - for (i = 0; i < count; i++) { - sysbus_init_irq(sbd, &array[i]); - } + sysbus_init_irqs(sbd, array, count); Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/smmuv3.c | 6 +----- hw/arm/stellaris.c | 5 +---- hw/arm/strongarm.c | 5 +---- hw/arm/versatilepb.c | 5 +---- hw/char/pl011.c | 5 +---- hw/char/renesas_sci.c | 5 +---- hw/core/platform-bus.c | 5 +---- hw/dma/pl330.c | 4 +--- hw/dma/sifive_pdma.c | 5 +---- hw/gpio/sifive_gpio.c | 5 +---- hw/i386/kvm/xen_evtchn.c | 5 +---- hw/intc/arm_gic_common.c | 20 +++++--------------- hw/intc/arm_gicv2m.c | 5 +---- hw/intc/exynos4210_combiner.c | 5 +---- hw/intc/loongarch_extioi.c | 7 ++----- hw/intc/loongson_liointc.c | 5 +---- hw/intc/openpic.c | 6 ++---- hw/intc/slavio_intctl.c | 6 ++---- hw/misc/avr_power.c | 4 +--- hw/misc/macio/gpio.c | 5 +---- hw/misc/stm32f4xx_exti.c | 5 +---- hw/net/cadence_gem.c | 5 +---- hw/net/mcf_fec.c | 5 +---- hw/pci-host/designware.c | 5 +---- hw/pci-host/ppce500.c | 4 +--- hw/pci-host/raven.c | 4 +--- hw/pci-host/sh_pci.c | 5 +---- hw/pci-host/versatile.c | 4 +--- hw/ppc/ppc405_uc.c | 10 ++-------- hw/ppc/ppc440_uc.c | 6 ++---- hw/ppc/ppc4xx_devs.c | 4 +--- hw/ppc/ppc4xx_pci.c | 5 +---- hw/ssi/ibex_spi_host.c | 5 +---- hw/ssi/imx_spi.c | 5 +---- hw/ssi/sifive_spi.c | 5 +---- hw/ssi/xilinx_spi.c | 5 +---- hw/ssi/xilinx_spips.c | 4 +--- hw/ssi/xlnx-versal-ospi.c | 4 +--- hw/timer/allwinner-a10-pit.c | 4 +--- hw/timer/exynos4210_mct.c | 4 +--- hw/timer/hpet.c | 4 +--- hw/timer/renesas_cmt.c | 5 +---- hw/timer/sifive_pwm.c | 5 +---- 43 files changed, 52 insertions(+), 178 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 932f009697..f080d97d3f 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1692,11 +1692,7 @@ static const MemoryRegionOps smmu_mem_ops = { static void smmu_init_irq(SMMUv3State *s, SysBusDevice *dev) { - int i; - - for (i = 0; i < ARRAY_SIZE(s->irq); i++) { - sysbus_init_irq(dev, &s->irq[i]); - } + sysbus_init_irqs(dev, s->irq, ARRAY_SIZE(s->irq)); } static void smmu_reset_hold(Object *obj) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index f7e99baf62..4bf9ef05c8 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -934,11 +934,8 @@ static void stellaris_adc_init(Object *obj) DeviceState *dev = DEVICE(obj); StellarisADCState *s = STELLARIS_ADC(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - int n; - for (n = 0; n < 4; n++) { - sysbus_init_irq(sbd, &s->irq[n]); - } + sysbus_init_irqs(sbd, s->irq, 4); memory_region_init_io(&s->iomem, obj, &stellaris_adc_ops, s, "adc", 0x1000); diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index cc73145053..f785dcf08e 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -658,7 +658,6 @@ static void strongarm_gpio_initfn(Object *obj) DeviceState *dev = DEVICE(obj); StrongARMGPIOInfo *s = STRONGARM_GPIO(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - int i; qdev_init_gpio_in(dev, strongarm_gpio_set, 28); qdev_init_gpio_out(dev, s->handler, 28); @@ -667,9 +666,7 @@ static void strongarm_gpio_initfn(Object *obj) "gpio", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - for (i = 0; i < 11; i++) { - sysbus_init_irq(sbd, &s->irqs[i]); - } + sysbus_init_irqs(sbd, s->irqs, 11); sysbus_init_irq(sbd, &s->irqX); } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 05b9462a5b..6a5b1fc53e 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -160,12 +160,9 @@ static void vpb_sic_init(Object *obj) DeviceState *dev = DEVICE(obj); vpb_sic_state *s = VERSATILE_PB_SIC(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - int i; qdev_init_gpio_in(dev, vpb_sic_set_irq, 32); - for (i = 0; i < 32; i++) { - sysbus_init_irq(sbd, &s->parent[i]); - } + sysbus_init_irqs(sbd, s->parent, 32); s->irq = 31; memory_region_init_io(&s->iomem, obj, &vpb_sic_ops, s, "vpb-sic", 0x1000); diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 77bbc2a982..2056e32385 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -442,13 +442,10 @@ static void pl011_init(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); PL011State *s = PL011(obj); - int i; memory_region_init_io(&s->iomem, OBJECT(s), &pl011_ops, s, "pl011", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - for (i = 0; i < ARRAY_SIZE(s->irq); i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, ARRAY_SIZE(s->irq)); s->clk = qdev_init_clock_in(DEVICE(obj), "clk", pl011_clock_update, s, ClockUpdate); diff --git a/hw/char/renesas_sci.c b/hw/char/renesas_sci.c index 1c63467290..d404976279 100644 --- a/hw/char/renesas_sci.c +++ b/hw/char/renesas_sci.c @@ -286,15 +286,12 @@ static void rsci_init(Object *obj) { SysBusDevice *d = SYS_BUS_DEVICE(obj); RSCIState *sci = RSCI(obj); - int i; memory_region_init_io(&sci->memory, OBJECT(sci), &sci_ops, sci, "renesas-sci", 0x8); sysbus_init_mmio(d, &sci->memory); - for (i = 0; i < SCI_NR_IRQ; i++) { - sysbus_init_irq(d, &sci->irq[i]); - } + sysbus_init_irqs(d, sci->irq, SCI_NR_IRQ); timer_init_ns(&sci->timer, QEMU_CLOCK_VIRTUAL, txend, sci); } diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c index b8487b26b6..5e75324434 100644 --- a/hw/core/platform-bus.c +++ b/hw/core/platform-bus.c @@ -182,7 +182,6 @@ static void platform_bus_realize(DeviceState *dev, Error **errp) { PlatformBusDevice *pbus; SysBusDevice *d; - int i; d = SYS_BUS_DEVICE(dev); pbus = PLATFORM_BUS_DEVICE(dev); @@ -193,9 +192,7 @@ static void platform_bus_realize(DeviceState *dev, Error **errp) pbus->used_irqs = bitmap_new(pbus->num_irqs); pbus->irqs = g_new0(qemu_irq, pbus->num_irqs); - for (i = 0; i < pbus->num_irqs; i++) { - sysbus_init_irq(d, &pbus->irqs[i]); - } + sysbus_init_irqs(d, pbus->irqs, pbus->num_irqs); /* some devices might be initialized before so update used IRQs map */ plaform_bus_refresh_irqs(pbus); diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index e7e67dd8b6..d1c24fa7b8 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -1620,9 +1620,7 @@ static void pl330_realize(DeviceState *dev, Error **errp) s->manager.is_manager = true; s->irq = g_new0(qemu_irq, s->num_events); - for (i = 0; i < s->num_events; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, s->num_events); qdev_init_gpio_in(dev, pl330_dma_stop_irq, PL330_PERIPH_NUM); diff --git a/hw/dma/sifive_pdma.c b/hw/dma/sifive_pdma.c index 1dd88f3479..61c138323b 100644 --- a/hw/dma/sifive_pdma.c +++ b/hw/dma/sifive_pdma.c @@ -454,15 +454,12 @@ static const MemoryRegionOps sifive_pdma_ops = { static void sifive_pdma_realize(DeviceState *dev, Error **errp) { SiFivePDMAState *s = SIFIVE_PDMA(dev); - int i; memory_region_init_io(&s->iomem, OBJECT(dev), &sifive_pdma_ops, s, TYPE_SIFIVE_PDMA, SIFIVE_PDMA_REG_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - for (i = 0; i < SIFIVE_PDMA_IRQS; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, SIFIVE_PDMA_IRQS); } static void sifive_pdma_class_init(ObjectClass *klass, void *data) diff --git a/hw/gpio/sifive_gpio.c b/hw/gpio/sifive_gpio.c index 78bf29e996..fcb863a3ef 100644 --- a/hw/gpio/sifive_gpio.c +++ b/hw/gpio/sifive_gpio.c @@ -362,10 +362,7 @@ static void sifive_gpio_realize(DeviceState *dev, Error **errp) TYPE_SIFIVE_GPIO, SIFIVE_GPIO_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); - - for (int i = 0; i < s->ngpio; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, s->ngpio); qdev_init_gpio_in(DEVICE(s), sifive_gpio_set, s->ngpio); qdev_init_gpio_out(DEVICE(s), s->output, s->ngpio); diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index 3048329474..12c4419907 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -303,16 +303,13 @@ void xen_evtchn_create(void) { XenEvtchnState *s = XEN_EVTCHN(sysbus_create_simple(TYPE_XEN_EVTCHN, -1, NULL)); - int i; xen_evtchn_singleton = s; qemu_mutex_init(&s->port_lock); s->gsi_bh = aio_bh_new(qemu_get_aio_context(), gsi_assert_bh, s); - for (i = 0; i < IOAPIC_NUM_PINS; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(s), &s->gsis[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(s), s->gsis, IOAPIC_NUM_PINS); /* * The Xen scheme for encoding PIRQ# into an MSI message is not diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c index a379cea395..1742c752eb 100644 --- a/hw/intc/arm_gic_common.c +++ b/hw/intc/arm_gic_common.c @@ -143,22 +143,12 @@ void gic_init_irqs_and_mmio(GICState *s, qemu_irq_handler handler, i += (GIC_INTERNAL * s->num_cpu); qdev_init_gpio_in(DEVICE(s), handler, i); - for (i = 0; i < s->num_cpu; i++) { - sysbus_init_irq(sbd, &s->parent_irq[i]); - } - for (i = 0; i < s->num_cpu; i++) { - sysbus_init_irq(sbd, &s->parent_fiq[i]); - } - for (i = 0; i < s->num_cpu; i++) { - sysbus_init_irq(sbd, &s->parent_virq[i]); - } - for (i = 0; i < s->num_cpu; i++) { - sysbus_init_irq(sbd, &s->parent_vfiq[i]); - } + sysbus_init_irqs(sbd, s->parent_irq, s->num_cpu); + sysbus_init_irqs(sbd, s->parent_fiq, s->num_cpu); + sysbus_init_irqs(sbd, s->parent_virq, s->num_cpu); + sysbus_init_irqs(sbd, s->parent_vfiq, s->num_cpu); if (s->virt_extn) { - for (i = 0; i < s->num_cpu; i++) { - sysbus_init_irq(sbd, &s->maintenance_irq[i]); - } + sysbus_init_irqs(sbd, s->maintenance_irq, s->num_cpu); } /* Distributor */ diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index d564b857eb..8167d5886c 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -135,7 +135,6 @@ static const MemoryRegionOps gicv2m_ops = { static void gicv2m_realize(DeviceState *dev, Error **errp) { ARMGICv2mState *s = ARM_GICV2M(dev); - int i; if (s->num_spi > GICV2M_NUM_SPI_MAX) { error_setg(errp, @@ -151,9 +150,7 @@ static void gicv2m_realize(DeviceState *dev, Error **errp) return; } - for (i = 0; i < s->num_spi; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->spi[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->spi, s->num_spi); msi_nonbroken = true; kvm_gsi_direct_mapping = true; diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 4ba448fdb1..eb793e5623 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -309,16 +309,13 @@ static void exynos4210_combiner_init(Object *obj) DeviceState *dev = DEVICE(obj); Exynos4210CombinerState *s = EXYNOS4210_COMBINER(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - unsigned int i; /* Allocate general purpose input signals and connect a handler to each of * them */ qdev_init_gpio_in(dev, exynos4210_combiner_handler, IIC_NIRQ); /* Connect SysBusDev irqs to device specific irqs */ - for (i = 0; i < IIC_NGRP; i++) { - sysbus_init_irq(sbd, &s->output_irq[i]); - } + sysbus_init_irqs(sbd, s->output_irq, IIC_NGRP); memory_region_init_io(&s->iomem, obj, &exynos4210_combiner_ops, s, "exynos4210-combiner", IIC_REGION_SIZE); diff --git a/hw/intc/loongarch_extioi.c b/hw/intc/loongarch_extioi.c index af75460643..64df7356f9 100644 --- a/hw/intc/loongarch_extioi.c +++ b/hw/intc/loongarch_extioi.c @@ -273,12 +273,9 @@ static void loongarch_extioi_instance_init(Object *obj) { SysBusDevice *dev = SYS_BUS_DEVICE(obj); LoongArchExtIOI *s = LOONGARCH_EXTIOI(obj); - int i, cpu, pin; - - for (i = 0; i < EXTIOI_IRQS; i++) { - sysbus_init_irq(dev, &s->irq[i]); - } + int cpu, pin; + sysbus_init_irqs(dev, s->irq, EXTIOI_IRQS); qdev_init_gpio_in(DEVICE(obj), extioi_setirq, EXTIOI_IRQS); for (cpu = 0; cpu < EXTIOI_CPUS; cpu++) { diff --git a/hw/intc/loongson_liointc.c b/hw/intc/loongson_liointc.c index cc11b544cb..37b5f473d4 100644 --- a/hw/intc/loongson_liointc.c +++ b/hw/intc/loongson_liointc.c @@ -221,13 +221,10 @@ static void irq_handler(void *opaque, int irq, int level) static void loongson_liointc_init(Object *obj) { struct loongson_liointc *p = LOONGSON_LIOINTC(obj); - int i; qdev_init_gpio_in(DEVICE(obj), irq_handler, 32); - for (i = 0; i < NUM_PARENTS; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(obj), p->parent_irq, NUM_PARENTS); memory_region_init_io(&p->mmio, obj, &pic_ops, p, TYPE_LOONGSON_LIOINTC, R_END); diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index c757adbe53..da9b833c33 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1505,7 +1505,7 @@ static void openpic_realize(DeviceState *dev, Error **errp) { SysBusDevice *d = SYS_BUS_DEVICE(dev); OpenPICState *opp = OPENPIC(dev); - int i, j; + int i; int list_count = 0; static const MemReg list_le[] = { {"glb", &openpic_glb_ops_le, @@ -1597,9 +1597,7 @@ static void openpic_realize(DeviceState *dev, Error **errp) for (i = 0; i < opp->nb_cpus; i++) { opp->dst[i].irqs = g_new0(qemu_irq, OPENPIC_OUTPUT_NB); - for (j = 0; j < OPENPIC_OUTPUT_NB; j++) { - sysbus_init_irq(d, &opp->dst[i].irqs[j]); - } + sysbus_init_irqs(d, opp->dst[i].irqs, OPENPIC_OUTPUT_NB); opp->dst[i].raised.queue_size = IRQQUEUE_SIZE_BITS; opp->dst[i].raised.queue = bitmap_new(IRQQUEUE_SIZE_BITS); diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index f7e59ba643..e2a3bd3e86 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -419,7 +419,7 @@ static void slavio_intctl_init(Object *obj) DeviceState *dev = DEVICE(obj); SLAVIO_INTCTLState *s = SLAVIO_INTCTL(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - unsigned int i, j; + unsigned int i; char slave_name[45]; qdev_init_gpio_in(dev, slavio_set_irq_all, 32 + MAX_CPUS); @@ -430,9 +430,7 @@ static void slavio_intctl_init(Object *obj) for (i = 0; i < MAX_CPUS; i++) { snprintf(slave_name, sizeof(slave_name), "slave-interrupt-controller-%i", i); - for (j = 0; j < MAX_PILS; j++) { - sysbus_init_irq(sbd, &s->cpu_irqs[i][j]); - } + sysbus_init_irqs(sbd, s->cpu_irqs[i], MAX_PILS); memory_region_init_io(&s->slaves[i].iomem, OBJECT(s), &slavio_intctl_mem_ops, &s->slaves[i], slave_name, INTCTL_SIZE); diff --git a/hw/misc/avr_power.c b/hw/misc/avr_power.c index a5412f2cfe..5c6806ecbc 100644 --- a/hw/misc/avr_power.c +++ b/hw/misc/avr_power.c @@ -83,10 +83,8 @@ static void avr_mask_init(Object *dev) memory_region_init_io(&s->iomem, dev, &avr_mask_ops, s, TYPE_AVR_MASK, 0x01); sysbus_init_mmio(busdev, &s->iomem); + sysbus_init_irqs(busdev, s->irq, 8); - for (int i = 0; i < 8; i++) { - sysbus_init_irq(busdev, &s->irq[i]); - } s->val = 0x00; } diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index 4deb330471..bfbcf4ed87 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -153,11 +153,8 @@ static void macio_gpio_init(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); MacIOGPIOState *s = MACIO_GPIO(obj); - int i; - for (i = 0; i < 10; i++) { - sysbus_init_irq(sbd, &s->gpio_extirqs[i]); - } + sysbus_init_irqs(sbd, s->gpio_extirqs, 10); memory_region_init_io(&s->gpiomem, OBJECT(s), &macio_gpio_ops, obj, "gpio", 0x30); diff --git a/hw/misc/stm32f4xx_exti.c b/hw/misc/stm32f4xx_exti.c index 02e7810046..3bfefbf49b 100644 --- a/hw/misc/stm32f4xx_exti.c +++ b/hw/misc/stm32f4xx_exti.c @@ -135,11 +135,8 @@ static const MemoryRegionOps stm32f4xx_exti_ops = { static void stm32f4xx_exti_init(Object *obj) { STM32F4xxExtiState *s = STM32F4XX_EXTI(obj); - int i; - for (i = 0; i < NUM_INTERRUPT_OUT_LINES; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(obj), s->irq, NUM_INTERRUPT_OUT_LINES); memory_region_init_io(&s->mmio, obj, &stm32f4xx_exti_ops, s, TYPE_STM32F4XX_EXTI, 0x400); diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 42ea2411a2..2a2293e0cc 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1606,7 +1606,6 @@ static NetClientInfo net_gem_info = { static void gem_realize(DeviceState *dev, Error **errp) { CadenceGEMState *s = CADENCE_GEM(dev); - int i; address_space_init(&s->dma_as, s->dma_mr ? s->dma_mr : get_system_memory(), "dma"); @@ -1626,9 +1625,7 @@ static void gem_realize(DeviceState *dev, Error **errp) return; } - for (i = 0; i < s->num_priority_queues; ++i) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, s->num_priority_queues); qemu_macaddr_default_if_unset(&s->conf.macaddr); diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c index 8aa27bd322..34d5ecce5e 100644 --- a/hw/net/mcf_fec.c +++ b/hw/net/mcf_fec.c @@ -651,13 +651,10 @@ static void mcf_fec_instance_init(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); mcf_fec_state *s = MCF_FEC_NET(obj); - int i; memory_region_init_io(&s->iomem, obj, &mcf_fec_ops, s, "fec", 0x400); sysbus_init_mmio(sbd, &s->iomem); - for (i = 0; i < FEC_NUM_IRQ; i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, FEC_NUM_IRQ); } static Property mcf_fec_properties[] = { diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 9e183caa48..b75fd3d5f5 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -668,11 +668,8 @@ static void designware_pcie_host_realize(DeviceState *dev, Error **errp) PCIHostState *pci = PCI_HOST_BRIDGE(dev); DesignwarePCIEHost *s = DESIGNWARE_PCIE_HOST(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - size_t i; - for (i = 0; i < ARRAY_SIZE(s->pci.irqs); i++) { - sysbus_init_irq(sbd, &s->pci.irqs[i]); - } + sysbus_init_irqs(sbd, s->pci.irqs, ARRAY_SIZE(s->pci.irqs)); memory_region_init_io(&s->mmio, OBJECT(s), diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 38814247f2..98ee49e4ee 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -446,9 +446,7 @@ static void e500_pcihost_realize(DeviceState *dev, Error **errp) h = PCI_HOST_BRIDGE(dev); s = PPC_E500_PCI_HOST_BRIDGE(dev); - for (i = 0; i < ARRAY_SIZE(s->irq); i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, ARRAY_SIZE(s->irq)); for (i = 0; i < PCI_NUM_PINS; i++) { s->irq_num[i] = s->first_pin_irq + i; diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 9a11ac4b2b..dd22964c27 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -239,9 +239,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp) int i; if (s->is_legacy_prep) { - for (i = 0; i < PCI_NUM_PINS; i++) { - sysbus_init_irq(dev, &s->pci_irqs[i]); - } + sysbus_init_irqs(dev, s->pci_irqs, PCI_NUM_PINS); } else { /* According to PReP specification section 6.1.6 "System Interrupt * Assignments", all PCI interrupts are routed via IRQ 15 */ diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 77e7bbc65f..6aade6e5d7 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -121,11 +121,8 @@ static void sh_pci_device_realize(DeviceState *dev, Error **errp) SysBusDevice *sbd = SYS_BUS_DEVICE(dev); SHPCIState *s = SH_PCI_HOST_BRIDGE(dev); PCIHostState *phb = PCI_HOST_BRIDGE(s); - int i; - for (i = 0; i < 4; i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, 4); phb->bus = pci_register_root_bus(dev, "pci", sh_pci_set_irq, sh_pci_map_irq, s->irq, diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 60d4e7cd92..3eb9ad6f5c 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -412,9 +412,7 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp) object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_VERSATILE_PCI_HOST); - for (i = 0; i < 4; i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, 4); if (s->realview) { mapfn = pci_vpb_rv_map_irq; diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c index 0cc68178ad..5faa40a9d4 100644 --- a/hw/ppc/ppc405_uc.c +++ b/hw/ppc/ppc405_uc.c @@ -265,11 +265,8 @@ static void ppc405_dma_realize(DeviceState *dev, Error **errp) { Ppc405DmaState *dma = PPC405_DMA(dev); Ppc4xxDcrDeviceState *dcr = PPC4xx_DCR_DEVICE(dev); - int i; - for (i = 0; i < ARRAY_SIZE(dma->irqs); i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dma), &dma->irqs[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dma), dma->irqs, ARRAY_SIZE(dma->irqs)); ppc4xx_dcr_register(dcr, DMA0_CR0, dma, &dcr_read_dma, &dcr_write_dma); ppc4xx_dcr_register(dcr, DMA0_CT0, dma, &dcr_read_dma, &dcr_write_dma); @@ -702,15 +699,12 @@ static void ppc405_gpt_realize(DeviceState *dev, Error **errp) { Ppc405GptState *s = PPC405_GPT(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - int i; s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &ppc4xx_gpt_cb, s); memory_region_init_io(&s->iomem, OBJECT(s), &gpt_ops, s, "gpt", 0xd4); sysbus_init_mmio(sbd, &s->iomem); - for (i = 0; i < ARRAY_SIZE(s->irqs); i++) { - sysbus_init_irq(sbd, &s->irqs[i]); - } + sysbus_init_irqs(sbd, s->irqs, ARRAY_SIZE(s->irqs)); } static void ppc405_gpt_finalize(Object *obj) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 651263926e..89e16766e4 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1004,7 +1004,7 @@ static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp) { PPC460EXPCIEState *s = PPC460EX_PCIE_HOST(dev); PCIHostState *pci = PCI_HOST_BRIDGE(dev); - int i, id; + int id; char buf[16]; switch (s->dcrn_base) { @@ -1020,9 +1020,7 @@ static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp) } snprintf(buf, sizeof(buf), "pcie%d-io", id); memory_region_init(&s->iomem, OBJECT(s), buf, UINT64_MAX); - for (i = 0; i < 4; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->irq, 4); snprintf(buf, sizeof(buf), "pcie.%d", id); pci->bus = pci_register_root_bus(DEVICE(s), buf, ppc460ex_set_irq, pci_swizzle_map_irq_fn, s, &s->iomem, diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index c1d111465d..f938ac80a4 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -193,9 +193,7 @@ static void ppc4xx_mal_realize(DeviceState *dev, Error **errp) mal->rxctpr = g_new0(uint32_t, mal->rxcnum); mal->rcbs = g_new0(uint32_t, mal->rxcnum); - for (i = 0; i < ARRAY_SIZE(mal->irqs); i++) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &mal->irqs[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), mal->irqs, ARRAY_SIZE(mal->irqs)); ppc4xx_dcr_register(dcr, MAL0_CFG, mal, &dcr_read_mal, &dcr_write_mal); ppc4xx_dcr_register(dcr, MAL0_ESR, mal, &dcr_read_mal, &dcr_write_mal); diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 1d4a50fa7c..55957af77d 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -318,14 +318,11 @@ static void ppc4xx_pcihost_realize(DeviceState *dev, Error **errp) PPC4xxPCIState *s; PCIHostState *h; PCIBus *b; - int i; h = PCI_HOST_BRIDGE(dev); s = PPC4xx_PCI_HOST_BRIDGE(dev); - for (i = 0; i < ARRAY_SIZE(s->irq); i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, ARRAY_SIZE(s->irq)); b = pci_register_root_bus(dev, NULL, ppc4xx_pci_set_irq, ppc4xx_pci_map_irq, s->irq, get_system_memory(), diff --git a/hw/ssi/ibex_spi_host.c b/hw/ssi/ibex_spi_host.c index 1ee7d88c22..512b09d13e 100644 --- a/hw/ssi/ibex_spi_host.c +++ b/hw/ssi/ibex_spi_host.c @@ -589,14 +589,11 @@ static void fifo_trigger_update(void *opaque) static void ibex_spi_host_realize(DeviceState *dev, Error **errp) { IbexSPIHostState *s = IBEX_SPI_HOST(dev); - int i; s->ssi = ssi_create_bus(dev, "ssi"); s->cs_lines = g_new0(qemu_irq, s->num_cs); - for (i = 0; i < s->num_cs; ++i) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cs_lines[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->cs_lines, s->num_cs); /* Setup CONFIGOPTS Multi-register */ s->config_opts = g_new0(uint32_t, s->num_cs); diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index 189423bb3a..86c130c77b 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -458,7 +458,6 @@ static const struct MemoryRegionOps imx_spi_ops = { static void imx_spi_realize(DeviceState *dev, Error **errp) { IMXSPIState *s = IMX_SPI(dev); - int i; s->bus = ssi_create_bus(dev, "spi"); @@ -467,9 +466,7 @@ static void imx_spi_realize(DeviceState *dev, Error **errp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); - for (i = 0; i < ECSPI_NUM_CS; ++i) { - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->cs_lines[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(dev), s->cs_lines, ECSPI_NUM_CS); fifo32_create(&s->tx_fifo, ECSPI_FIFO_SIZE); fifo32_create(&s->rx_fifo, ECSPI_FIFO_SIZE); diff --git a/hw/ssi/sifive_spi.c b/hw/ssi/sifive_spi.c index 1b4a401ca1..928c7c5035 100644 --- a/hw/ssi/sifive_spi.c +++ b/hw/ssi/sifive_spi.c @@ -310,15 +310,12 @@ static void sifive_spi_realize(DeviceState *dev, Error **errp) { SysBusDevice *sbd = SYS_BUS_DEVICE(dev); SiFiveSPIState *s = SIFIVE_SPI(dev); - int i; s->spi = ssi_create_bus(dev, "spi"); sysbus_init_irq(sbd, &s->irq); s->cs_lines = g_new0(qemu_irq, s->num_cs); - for (i = 0; i < s->num_cs; i++) { - sysbus_init_irq(sbd, &s->cs_lines[i]); - } + sysbus_init_irqs(sbd, s->cs_lines, s->num_cs); memory_region_init_io(&s->mmio, OBJECT(s), &sifive_spi_ops, s, TYPE_SIFIVE_SPI, 0x1000); diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c index d4de2e7aab..e0ea0bb1cf 100644 --- a/hw/ssi/xilinx_spi.c +++ b/hw/ssi/xilinx_spi.c @@ -327,7 +327,6 @@ static void xilinx_spi_realize(DeviceState *dev, Error **errp) { SysBusDevice *sbd = SYS_BUS_DEVICE(dev); XilinxSPI *s = XILINX_SPI(dev); - int i; DB_PRINT("\n"); @@ -335,9 +334,7 @@ static void xilinx_spi_realize(DeviceState *dev, Error **errp) sysbus_init_irq(sbd, &s->irq); s->cs_lines = g_new0(qemu_irq, s->num_cs); - for (i = 0; i < s->num_cs; ++i) { - sysbus_init_irq(sbd, &s->cs_lines[i]); - } + sysbus_init_irqs(sbd, s->cs_lines, s->num_cs); memory_region_init_io(&s->mmio, OBJECT(s), &spi_ops, s, "xilinx-spi", R_MAX * 4); diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index 97009d3a5d..c696a07916 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -1294,9 +1294,7 @@ static void xilinx_spips_realize(DeviceState *dev, Error **errp) s->cs_lines_state = g_new0(bool, s->num_cs * s->num_busses); sysbus_init_irq(sbd, &s->irq); - for (i = 0; i < s->num_cs * s->num_busses; ++i) { - sysbus_init_irq(sbd, &s->cs_lines[i]); - } + sysbus_init_irqs(sbd, s->cs_lines, s->num_cs * s->num_busses); memory_region_init_io(&s->iomem, OBJECT(s), xsc->reg_ops, s, "spi", XLNX_ZYNQMP_SPIPS_R_MAX * 4); diff --git a/hw/ssi/xlnx-versal-ospi.c b/hw/ssi/xlnx-versal-ospi.c index c762e0b367..b280fbedaf 100644 --- a/hw/ssi/xlnx-versal-ospi.c +++ b/hw/ssi/xlnx-versal-ospi.c @@ -1740,9 +1740,7 @@ static void xlnx_versal_ospi_realize(DeviceState *dev, Error **errp) s->num_cs = 4; s->spi = ssi_create_bus(dev, "spi0"); s->cs_lines = g_new0(qemu_irq, s->num_cs); - for (int i = 0; i < s->num_cs; ++i) { - sysbus_init_irq(sbd, &s->cs_lines[i]); - } + sysbus_init_irqs(sbd, s->cs_lines, s->num_cs); fifo8_create(&s->rx_fifo, RXFF_SZ); fifo8_create(&s->tx_fifo, TXFF_SZ); diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c index 971f78462a..1126d19127 100644 --- a/hw/timer/allwinner-a10-pit.c +++ b/hw/timer/allwinner-a10-pit.c @@ -263,9 +263,7 @@ static void a10_pit_init(Object *obj) SysBusDevice *sbd = SYS_BUS_DEVICE(obj); uint8_t i; - for (i = 0; i < AW_A10_PIT_TIMER_NR; i++) { - sysbus_init_irq(sbd, &s->irq[i]); - } + sysbus_init_irqs(sbd, s->irq, AW_A10_PIT_TIMER_NR); memory_region_init_io(&s->iomem, OBJECT(s), &a10_pit_ops, s, TYPE_AW_A10_PIT, 0x400); sysbus_init_mmio(sbd, &s->iomem); diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index 446bbd2b96..6a53068a1d 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -1521,9 +1521,7 @@ static void exynos4210_mct_init(Object *obj) } /* IRQs */ - for (i = 0; i < MCT_GT_CMP_NUM; i++) { - sysbus_init_irq(dev, &s->g_timer.irq[i]); - } + sysbus_init_irqs(dev, s->g_timer.irq, MCT_GT_CMP_NUM); for (i = 0; i < 2; i++) { sysbus_init_irq(dev, &s->l_timer[i].irq); } diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 6998094233..95b68f1c90 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -756,9 +756,7 @@ static void hpet_realize(DeviceState *dev, Error **errp) s->hpet_id = hpet_cfg.count++; - for (i = 0; i < HPET_NUM_IRQ_ROUTES; i++) { - sysbus_init_irq(sbd, &s->irqs[i]); - } + sysbus_init_irqs(sbd, s->irqs, HPET_NUM_IRQ_ROUTES); if (s->num_timers < HPET_MIN_TIMERS) { s->num_timers = HPET_MIN_TIMERS; diff --git a/hw/timer/renesas_cmt.c b/hw/timer/renesas_cmt.c index 69eabc678a..3fae6d40d7 100644 --- a/hw/timer/renesas_cmt.c +++ b/hw/timer/renesas_cmt.c @@ -225,15 +225,12 @@ static void rcmt_init(Object *obj) { SysBusDevice *d = SYS_BUS_DEVICE(obj); RCMTState *cmt = RCMT(obj); - int i; memory_region_init_io(&cmt->memory, OBJECT(cmt), &cmt_ops, cmt, "renesas-cmt", 0x10); sysbus_init_mmio(d, &cmt->memory); - for (i = 0; i < ARRAY_SIZE(cmt->cmi); i++) { - sysbus_init_irq(d, &cmt->cmi[i]); - } + sysbus_init_irqs(d, cmt->cmi, ARRAY_SIZE(cmt->cmi)); timer_init_ns(&cmt->timer[0], QEMU_CLOCK_VIRTUAL, timer_event0, cmt); timer_init_ns(&cmt->timer[1], QEMU_CLOCK_VIRTUAL, timer_event1, cmt); } diff --git a/hw/timer/sifive_pwm.c b/hw/timer/sifive_pwm.c index c664480ccf..d5f1273232 100644 --- a/hw/timer/sifive_pwm.c +++ b/hw/timer/sifive_pwm.c @@ -414,11 +414,8 @@ static Property sifive_pwm_properties[] = { static void sifive_pwm_init(Object *obj) { SiFivePwmState *s = SIFIVE_PWM(obj); - int i; - for (i = 0; i < SIFIVE_PWM_IRQS; i++) { - sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irqs[i]); - } + sysbus_init_irqs(SYS_BUS_DEVICE(obj), s->irqs, SIFIVE_PWM_IRQS); memory_region_init_io(&s->mmio, obj, &sifive_pwm_ops, s, TYPE_SIFIVE_PWM, 0x100); From patchwork Thu Jun 1 09:46:25 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: 687702 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp239950wru; Thu, 1 Jun 2023 02:48:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ59+4d5ycf1Km00Fn7Wyut8zQpW7ompaCkH7q+EnBst+ODatODiIMK9sxVTAlx320dRiAUD X-Received: by 2002:a05:6214:767:b0:626:31ad:f87c with SMTP id f7-20020a056214076700b0062631adf87cmr8737784qvz.21.1685612919920; Thu, 01 Jun 2023 02:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685612919; cv=none; d=google.com; s=arc-20160816; b=budG8OQutEbARMxJMDDv5jC6uzShDuVITRKdkywUPmfbXxhellk9D5tNFWKWVkCsFK T5LSSgDFFCIYRyJVaaNZUskWNvqH12Zs6iP6MVWJ6S0RlLIzXmd7SEoz8US5zBJkyggg GyozeW7kDHZsFvaQVOrchKG2q4gWmbAvAoesGIVDPzdbd/Cu2LzHsLTgAcBK4sBMuDmN ZUSAXdmHm6kqSLfn+Vj6HjcE0+h1aHInRCnEIZEV7tT88SoXNgQoI5dRuAOe2QK19jLE 7zFWUpKCKdijspFR389vv3s/NIWCCdiuMbfukVFBDbz6m7fNxSI4qbuCSHgwRyjcrtsu fj6Q== 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=HmhQNJHFAcag6yz9sQ/XjOqESAjbgaIMCNWmwxbtuwY=; b=oxl4CntQLIgK+AKtt1oUXEGy5f8V1ZFSb0fauu8qCFjpb/WMUs7EgscQ2417RlKOdi FYe2g1aUQe0/xoszMBrswbS16qiRfn1Sb1z+rgn8FlWRMGqz4TPh44yrxFoJZPBfElIE a2rGszRvih1Ww9LVYJ9pY5Zpr7gprO2TCet4iAGToIZ9DfarVXgwd5hrperjaJV9E46T 4PU81qkbj+c9kROuvOc+jTiLsv8Xd1JFiS8SyU1x/fV7lzjR9iOS2pR38PnycHdGCoGX iPcq23KW6vvg/qXf0mWlzCAhh7gbaRLudzBSqJn2lkbfnD7nf3JBRBsDqPcO4mPFNnCq YSGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oUMo5NqB; 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 gu5-20020a056214260500b00625821b9282si10133702qvb.116.2023.06.01.02.48.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jun 2023 02:48:39 -0700 (PDT) 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=oUMo5NqB; 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 1q4etm-0005DF-OW; Thu, 01 Jun 2023 05:47:14 -0400 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 1q4eth-00055p-Nt for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:10 -0400 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 1q4etf-0004Ox-QX for qemu-devel@nongnu.org; Thu, 01 Jun 2023 05:47:09 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f603ff9c02so6552915e9.2 for ; Thu, 01 Jun 2023 02:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685612826; x=1688204826; 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=HmhQNJHFAcag6yz9sQ/XjOqESAjbgaIMCNWmwxbtuwY=; b=oUMo5NqB7r7wpUyHbTnnyba9E+v4zPJn/YthIR6MoVYSi63MUEqLISYD/BQWvOPMRi pR6MWoL+UXLpRAzyNnE0n75OoEK7+YlRiilyjaTsQgo47iho3lMWfaStvse80HY/e9HM jHjYspQh++nXBboB4vd3Q0tKRhekV2cfv+JbwDECbWwavWR5djK/TjaFjzFVMqcRcLMX pY5itrfeoEbDSiw2+8L4oDapN8UXuURbjjbOpgnbniwAw5sQlAm4hI3L6c+EG14/H1mR 2TrNEzH7NaWhFqnufdZ7aS1sx3zztEOgnUt5Y5/oIV129q7eBtMFCG7yZFbmZj2GnhaG IQkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685612826; x=1688204826; 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=HmhQNJHFAcag6yz9sQ/XjOqESAjbgaIMCNWmwxbtuwY=; b=cmXwkKyEOgN6WS7fZKyv9fxCoHxHEQLQdvJVmLGJnOTTUcpmXSKAIe/jktX/TwGxky jLjlI8+Nr6h7hOR2rYXBSrlQKakXy2eaGrKmoQcf32QibLVxJZc+HQR0KbsVcJdc/5E/ tpfVjNYqnjxT/Khv2wQfuQ2Qi+IuXtkJMM0GQnWwm5b5Wuy6hk+695BI3Q8aEkvSkisS O2xTAt7S7pPruovSnZgF4ExWglNnbNmLMIfYRpORlgzV0m01Vq18NBocn5MkTO5zBSjH NPt5Hr9WgndP3NIOTyvbOUdmFHIlOw9meIFte5LEFYCsAKx3jzm9BqUFXBAdgk8YGYh2 yJEQ== X-Gm-Message-State: AC+VfDy8mV4acbDTJZuiK7PRzDtH3H4pTNZf7xH3E0E+tcs7G0cSe5um cnt+pvvQjqgSnxn3QthXQQs4iNaz0wCas8OngVo= X-Received: by 2002:a7b:cd0f:0:b0:3f6:4f1:cfbf with SMTP id f15-20020a7bcd0f000000b003f604f1cfbfmr1134766wmj.20.1685612826405; Thu, 01 Jun 2023 02:47:06 -0700 (PDT) Received: from localhost.localdomain ([176.176.141.224]) by smtp.gmail.com with ESMTPSA id bg22-20020a05600c3c9600b003f4283f5c1bsm8570794wmb.2.2023.06.01.02.47.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 Jun 2023 02:47:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Markus Armbruster , qemu-ppc@nongnu.org, Eduardo Habkost , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 7/7] hw: Simplify using sysbus_init_irqs() [manual] Date: Thu, 1 Jun 2023 11:46:25 +0200 Message-Id: <20230601094625.39569-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230601094625.39569-1-philmd@linaro.org> References: <20230601094625.39569-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Audit the sysbus_init_irq() calls and manually convert to sysbus_init_irqs() when a loop is involved. In omap2_intc_init(), the parent_intr[] array contains 2 elements: use ARRAY_SIZE() to iterate over. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/omap_intc.c | 3 +-- hw/pci-host/gpex.c | 2 +- hw/timer/renesas_tmr.c | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index 647bf324a8..f324b640e3 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -627,8 +627,7 @@ static void omap2_intc_init(Object *obj) s->level_only = 1; s->nbanks = 3; - sysbus_init_irq(sbd, &s->parent_intr[0]); - sysbus_init_irq(sbd, &s->parent_intr[1]); + sysbus_init_irqs(sbd, s->parent_intr, ARRAY_SIZE(s->parent_intr)); qdev_init_gpio_in(dev, omap_set_intr_noedge, s->nbanks * 32); memory_region_init_io(&s->mmio, obj, &omap2_inth_mem_ops, s, "omap2-intc", 0x1000); diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index a6752fac5e..7b46e3e36e 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -128,8 +128,8 @@ static void gpex_host_realize(DeviceState *dev, Error **errp) sysbus_init_mmio(sbd, &s->io_ioport); } + sysbus_init_irqs(sbd, s->irq, GPEX_NUM_IRQS); for (i = 0; i < GPEX_NUM_IRQS; i++) { - sysbus_init_irq(sbd, &s->irq[i]); s->irq_num[i] = -1; } diff --git a/hw/timer/renesas_tmr.c b/hw/timer/renesas_tmr.c index c15f654738..dd2929d6e7 100644 --- a/hw/timer/renesas_tmr.c +++ b/hw/timer/renesas_tmr.c @@ -428,17 +428,14 @@ static void rtmr_init(Object *obj) { SysBusDevice *d = SYS_BUS_DEVICE(obj); RTMRState *tmr = RTMR(obj); - int i; memory_region_init_io(&tmr->memory, OBJECT(tmr), &tmr_ops, tmr, "renesas-tmr", 0x10); sysbus_init_mmio(d, &tmr->memory); - for (i = 0; i < ARRAY_SIZE(tmr->ovi); i++) { - sysbus_init_irq(d, &tmr->cmia[i]); - sysbus_init_irq(d, &tmr->cmib[i]); - sysbus_init_irq(d, &tmr->ovi[i]); - } + sysbus_init_irqs(d, tmr->cmia, ARRAY_SIZE(tmr->cmia)); + sysbus_init_irqs(d, tmr->cmib, ARRAY_SIZE(tmr->cmib)); + sysbus_init_irqs(d, tmr->ovi, ARRAY_SIZE(tmr->ovi)); timer_init_ns(&tmr->timer[0], QEMU_CLOCK_VIRTUAL, timer_event0, tmr); timer_init_ns(&tmr->timer[1], QEMU_CLOCK_VIRTUAL, timer_event1, tmr); }