From nobody Wed Dec 17 06:31:37 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14B201D5406; Mon, 17 Jun 2024 13:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632281; cv=none; b=XMuDaFzDPQbLhx5QNhzD95y3UAAIKHYfzL73y05FUTV6kr5M26EixklVP4fWIbS89bFBGgaWsEjlkQsDFPvrmGkz9Iiss43Ms7WwB+dbmTStdsdeXK0gdTTNLbbxTUXbKJudOPbyENR0xNDxTrlKQmWjKLCFXDp4FaACtNyFR/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632281; c=relaxed/simple; bh=L2Wup6EGvVy1P2uNeAyPQrnnTBCFq4QOvGcPCAKjXqo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=YBwtQFIY3A+RrHig29iEGDcUVdsdS/yJvXb6ClXLaPZDc4UHLE3ldFrdUltkOyI5+sC0XS6AlEBkND5tBHWw4kOtJRFEKCSIkj1hhkk7ch/tzcDwi8sTiB4NmH+KrNmgTo6N/QJgWBbLr7IznJUrF9sZgbe7Z2ISWPapUo3cerU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YyTkIjKe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=A5Tv8PMp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YyTkIjKe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="A5Tv8PMp" Date: Mon, 17 Jun 2024 13:51:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718632272; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=onOQ6/RB4rhAEIwUfEu8vsqGTwNSgd2uCU63ADWgiWA=; b=YyTkIjKe4nBDtULMe6SceCC5D4zG3X2KEBZxAtAGI+SDGA13F53lhsKHOmXQri3V9GF+Cb +BQ2rbY3lCr8TUIJwb/Wyi4rOHPEzOsUVlo1JlwRTpY38S/cD+4CFrNeIuuDqQ8X+g0sf4 0+SilP1fDiELRDhnyh72TP4kXElWjrKHwrJmCovN383ODxmvt+Ke4iODVnYB64ved3rU7S uxT0vd+IDDHdSAgP+p9f0lwNE1mX0Uh87eSM48H1CQ5axom9ADcL78z3nQosWEAL4McdnQ CGZ0taFXU90QwxCc4WJg1fBmRQcsHD0WEwQ3tWnoRJCHN7iuZaHJJijG9ahgHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718632272; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=onOQ6/RB4rhAEIwUfEu8vsqGTwNSgd2uCU63ADWgiWA=; b=A5Tv8PMp+pkxv6Ehxlsyj8VWCP/5Rw7m36hsIVF7Gc/VZE0r2XFdhmKy3EuY6E6kVEeLyg Zz8Rjdhkixc417Ag== From: "tip-bot2 for Herve Codina" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqdomain: Convert __irq_domain_create() to use struct irq_domain_info Cc: Thomas Gleixner , Herve Codina , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240614173232.1184015-7-herve.codina@bootlin.com> References: <20240614173232.1184015-7-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171863227259.10875.9213959710476410531.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: 24a4f4e48557dddf2bb722df7b01184efc92a6a7 Gitweb: https://git.kernel.org/tip/24a4f4e48557dddf2bb722df7b01184ef= c92a6a7 Author: Herve Codina AuthorDate: Fri, 14 Jun 2024 19:32:07 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 17 Jun 2024 15:48:13 +02:00 irqdomain: Convert __irq_domain_create() to use struct irq_domain_info The existing __irq_domain_create() use a bunch of parameters to create an irq domain. With the introduction of irq_domain_info structure, these parameters are available in the information structure itself. Using directly this information structure allows future flexibility to add other parameters in a simple way without the need to change the __irq_domain_create() prototype. Convert __irq_domain_create() to use the information structure. [ tglx: Fixup struct initializer ] Suggested-by: Thomas Gleixner Signed-off-by: Herve Codina Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240614173232.1184015-7-herve.codina@bootl= in.com --- kernel/irq/irqdomain.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index a7be776..0eda48f 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -179,45 +179,40 @@ static int irq_domain_set_name(struct irq_domain *dom= ain, return 0; } =20 -static struct irq_domain *__irq_domain_create(struct fwnode_handle *fwnode, - unsigned int size, - irq_hw_number_t hwirq_max, - int direct_max, - const struct irq_domain_ops *ops, - void *host_data) +static struct irq_domain *__irq_domain_create(const struct irq_domain_info= *info) { struct irq_domain *domain; int err; =20 - if (WARN_ON((size && direct_max) || - (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max) || - (direct_max && direct_max !=3D hwirq_max))) + if (WARN_ON((info->size && info->direct_max) || + (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && info->direct_max) || + (info->direct_max && info->direct_max !=3D info->hwirq_max))) return NULL; =20 - domain =3D kzalloc_node(struct_size(domain, revmap, size), - GFP_KERNEL, of_node_to_nid(to_of_node(fwnode))); + domain =3D kzalloc_node(struct_size(domain, revmap, info->size), + GFP_KERNEL, of_node_to_nid(to_of_node(info->fwnode))); if (!domain) return NULL; =20 - err =3D irq_domain_set_name(domain, fwnode); + err =3D irq_domain_set_name(domain, info->fwnode); if (err) { kfree(domain); return NULL; } =20 - domain->fwnode =3D fwnode_handle_get(fwnode); + domain->fwnode =3D fwnode_handle_get(info->fwnode); fwnode_dev_initialized(domain->fwnode, true); =20 /* Fill structure */ INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL); - domain->ops =3D ops; - domain->host_data =3D host_data; - domain->hwirq_max =3D hwirq_max; + domain->ops =3D info->ops; + domain->host_data =3D info->host_data; + domain->hwirq_max =3D info->hwirq_max; =20 - if (direct_max) + if (info->direct_max) domain->flags |=3D IRQ_DOMAIN_FLAG_NO_MAP; =20 - domain->revmap_size =3D size; + domain->revmap_size =3D info->size; =20 /* * Hierarchical domains use the domain lock of the root domain @@ -264,8 +259,7 @@ struct irq_domain *irq_domain_instantiate(const struct = irq_domain_info *info) { struct irq_domain *domain; =20 - domain =3D __irq_domain_create(info->fwnode, info->size, info->hwirq_max, - info->direct_max, info->ops, info->host_data); + domain =3D __irq_domain_create(info); if (!domain) return ERR_PTR(-ENOMEM); =20 @@ -1204,13 +1198,19 @@ struct irq_domain *irq_domain_create_hierarchy(stru= ct irq_domain *parent, const struct irq_domain_ops *ops, void *host_data) { + struct irq_domain_info info =3D { + .fwnode =3D fwnode, + .size =3D size, + .hwirq_max =3D size, + .ops =3D ops, + .host_data =3D host_data, + }; struct irq_domain *domain; =20 - if (size) - domain =3D __irq_domain_create(fwnode, size, size, 0, ops, host_data); - else - domain =3D __irq_domain_create(fwnode, 0, ~0, 0, ops, host_data); + if (!info.size) + info.hwirq_max =3D ~0U; =20 + domain =3D __irq_domain_create(&info); if (domain) { if (parent) domain->root =3D parent->root;