From nobody Thu Dec 18 13:45:32 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 33A372361F3 for ; Wed, 15 Jan 2025 08:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736931263; cv=none; b=Ki9HZ7vquIYOdVS8zAGN4Gsal5jVWmKsw1GupYXFuw1ChOCaV+vj4vN5FExJf93g/8Fo9cyvYXvdVGlYwOtq7o2fmYgiVNr7t35XIPF3zBHt0pRVEqS9FS56Ym2pmjBW5bX9EmxyIAK6U580ltF7eQ+G0gYK9JC9zwHlg8F5JTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736931263; c=relaxed/simple; bh=ezJytLmiRU8NOmXj9Q1Mq5VZHZL4COwTD0lR2SGaEwQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QUvKU1JDElBZL7uEUCf6++uoj6azuw/+9ZVkcTxikj4G1xIpd7GybSwzRYYxCW/4oDmGG/2nQnPMcbn8q6yYJjSwxvxPyKVQfGwxSYqR4Y/nkiYysM8BUmKeEse88Lh2RE74B/8tnMpRMS114IUFI9MpCg0qIMqDbVohoxpd1i4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GiPKszYR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GiPKszYR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE82C4CEE2; Wed, 15 Jan 2025 08:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736931263; bh=ezJytLmiRU8NOmXj9Q1Mq5VZHZL4COwTD0lR2SGaEwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GiPKszYR22P8+2NkEUNK9ftJJeGbnEtHax2Ijh0xN81xwia0NHGashOcqs7jiPSoo 2uedfXEX+LxOE6Gx0jDaLIqeKrOxjH2TWL1CTuJiwCdd6re4mgIETfA5AOhiqB1o6K ELX4ial36/19iMkfkCAae2SDY0sp99zVbyMhoQWr8X2VT7J8df+jBRlfq7rZLnITEs 8rhoTwH8w/4M/mlWCU11BnKTkv5qj1+uDE1mQ2WhdKMQUVYh2NNSxVBMUt9zEk3Q7d lZQGxVvCOPjj4rr69w7Wrzvk35hgPye1TqppPv6oMoSR71FJtvvXV+8+9JBxlQh2ZP a/V08VOwlisDw== From: "Jiri Slaby (SUSE)" To: tglx@linutronix.de Cc: maz@kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 06/18] irqdomain: Make a couple of functions an inline Date: Wed, 15 Jan 2025 09:53:55 +0100 Message-ID: <20250115085409.1629787-7-jirislaby@kernel.org> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250115085409.1629787-1-jirislaby@kernel.org> References: <20250115085409.1629787-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no reason to export these functions as extra symbols. They are simple enough and are just wrappers to already exported functions. So switch the exported functions to inlines. Signed-off-by: Jiri Slaby (SUSE) --- include/linux/irqdomain.h | 78 +++++++++++++++++++++++++++++++++------ kernel/irq/irqdomain.c | 68 ---------------------------------- 2 files changed, 66 insertions(+), 80 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 1f4af32d464a..15919ca8b3cb 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -338,18 +338,39 @@ struct irq_domain *irq_domain_create_simple(struct fw= node_handle *fwnode, unsigned int first_irq, const struct irq_domain_ops *ops, void *host_data); -struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, - unsigned int size, - unsigned int first_irq, - irq_hw_number_t first_hwirq, - const struct irq_domain_ops *ops, - void *host_data); struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode, unsigned int size, unsigned int first_irq, irq_hw_number_t first_hwirq, const struct irq_domain_ops *ops, void *host_data); + +/** + * irq_domain_add_legacy() - Allocate and register a legacy revmap irq_dom= ain. + * @of_node: pointer to interrupt controller's device tree node. + * @size: total number of irqs in legacy mapping + * @first_irq: first number of irq block assigned to the domain + * @first_hwirq: first hwirq number to use for the translation. Should nor= mally + * be '0', but a positive integer can be used if the effecti= ve + * hwirqs numbering does not begin at zero. + * @ops: map/unmap domain callbacks + * @host_data: Controller private data pointer + * + * Note: the map() callback will be called before this function returns + * for all legacy interrupts except 0 (which is always the invalid irq for + * a legacy controller). + */ +static inline struct irq_domain *irq_domain_add_legacy(struct device_node = *of_node, + unsigned int size, + unsigned int first_irq, + irq_hw_number_t first_hwirq, + const struct irq_domain_ops *ops, + void *host_data) +{ + return irq_domain_create_legacy(of_fwnode_handle(of_node), size, + first_irq, first_hwirq, ops, host_data); +} + struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, enum irq_domain_bus_token bus_token); void irq_set_default_domain(struct irq_domain *domain); @@ -591,12 +612,45 @@ void irq_domain_set_info(struct irq_domain *domain, u= nsigned int virq, void *handler_data, const char *handler_name); void irq_domain_reset_irq_data(struct irq_data *irq_data); #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY -struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, - unsigned int flags, - unsigned int size, - struct fwnode_handle *fwnode, - const struct irq_domain_ops *ops, - void *host_data); +/** + * irq_domain_create_hierarchy - Add a irqdomain into the hierarchy + * @parent: Parent irq domain to associate with the new domain + * @flags: Irq domain flags associated to the domain + * @size: Size of the domain. See below + * @fwnode: Optional fwnode of the interrupt controller + * @ops: Pointer to the interrupt domain callbacks + * @host_data: Controller private data pointer + * + * If @size is 0 a tree domain is created, otherwise a linear domain. + * + * If successful the parent is associated to the new domain and the + * domain flags are set. + * Returns pointer to IRQ domain, or NULL on failure. + */ +static inline struct irq_domain *irq_domain_create_hierarchy(struct irq_do= main *parent, + unsigned int flags, + unsigned int size, + struct fwnode_handle *fwnode, + 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, + .domain_flags =3D flags, + .parent =3D parent, + }; + struct irq_domain *d; + + if (!info.size) + info.hwirq_max =3D ~0U; + + d =3D irq_domain_instantiate(&info); + return IS_ERR(d) ? NULL : d; +} =20 static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domai= n *parent, unsigned int flags, diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index cf4616829f43..00f254a67bb0 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -480,33 +480,6 @@ struct irq_domain *irq_domain_create_simple(struct fwn= ode_handle *fwnode, } EXPORT_SYMBOL_GPL(irq_domain_create_simple); =20 -/** - * irq_domain_add_legacy() - Allocate and register a legacy revmap irq_dom= ain. - * @of_node: pointer to interrupt controller's device tree node. - * @size: total number of irqs in legacy mapping - * @first_irq: first number of irq block assigned to the domain - * @first_hwirq: first hwirq number to use for the translation. Should nor= mally - * be '0', but a positive integer can be used if the effecti= ve - * hwirqs numbering does not begin at zero. - * @ops: map/unmap domain callbacks - * @host_data: Controller private data pointer - * - * Note: the map() callback will be called before this function returns - * for all legacy interrupts except 0 (which is always the invalid irq for - * a legacy controller). - */ -struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, - unsigned int size, - unsigned int first_irq, - irq_hw_number_t first_hwirq, - const struct irq_domain_ops *ops, - void *host_data) -{ - return irq_domain_create_legacy(of_fwnode_handle(of_node), size, - first_irq, first_hwirq, ops, host_data); -} -EXPORT_SYMBOL_GPL(irq_domain_add_legacy); - struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode, unsigned int size, unsigned int first_irq, @@ -1252,47 +1225,6 @@ void irq_domain_reset_irq_data(struct irq_data *irq_= data) EXPORT_SYMBOL_GPL(irq_domain_reset_irq_data); =20 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY -/** - * irq_domain_create_hierarchy - Add a irqdomain into the hierarchy - * @parent: Parent irq domain to associate with the new domain - * @flags: Irq domain flags associated to the domain - * @size: Size of the domain. See below - * @fwnode: Optional fwnode of the interrupt controller - * @ops: Pointer to the interrupt domain callbacks - * @host_data: Controller private data pointer - * - * If @size is 0 a tree domain is created, otherwise a linear domain. - * - * If successful the parent is associated to the new domain and the - * domain flags are set. - * Returns pointer to IRQ domain, or NULL on failure. - */ -struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, - unsigned int flags, - unsigned int size, - struct fwnode_handle *fwnode, - 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, - .domain_flags =3D flags, - .parent =3D parent, - }; - struct irq_domain *d; - - if (!info.size) - info.hwirq_max =3D ~0U; - - d =3D irq_domain_instantiate(&info); - return IS_ERR(d) ? NULL : d; -} -EXPORT_SYMBOL_GPL(irq_domain_create_hierarchy); - static void irq_domain_insert_irq(int virq) { struct irq_data *data; --=20 2.48.0