From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3FCDC4361B for ; Sat, 19 Dec 2020 21:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9F1523426 for ; Sat, 19 Dec 2020 21:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727912AbgLSVfw (ORCPT ); Sat, 19 Dec 2020 16:35:52 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:34648 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbgLSVfv (ORCPT ); Sat, 19 Dec 2020 16:35:51 -0500 Received: from [192.168.42.210] ([93.23.15.221]) by mwinf5d37 with ME id 6Ma4240034mA9Nd03Ma4rr; Sat, 19 Dec 2020 22:34:06 +0100 X-ME-Helo: [192.168.42.210] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 19 Dec 2020 22:34:06 +0100 X-ME-IP: 93.23.15.221 Subject: Re: [PATCH] irqdomain: Add documentation for irq_create_of_mapping() To: Marc Zyngier Cc: tglx@linutronix.de, mripard@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20201215200747.148439-1-christophe.jaillet@wanadoo.fr> <87sg83q6t4.wl-maz@kernel.org> From: Marion & Christophe JAILLET Message-ID: <5bddaaae-d7d2-7ede-ab3f-db1ff9353c2d@wanadoo.fr> Date: Sat, 19 Dec 2020 22:34:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <87sg83q6t4.wl-maz@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 18/12/2020 à 19:59, Marc Zyngier a écrit : > Hi Christophe, > > On Tue, 15 Dec 2020 20:07:47 +0000, > Christophe JAILLET wrote: >> Add a description for 'irq_create_of_mapping()' and make explicit the fact >> that the resources allocated by this function can be freed by calling >> 'irq_dispose_mapping()' when needed (i.e. error handling path, remove >> function, ...) >> >> Signed-off-by: Christophe JAILLET >> --- >> The wording can certainly be improved. >> >> My goal is only to make clear if patches such as: >> https://lore.kernel.org/lkml/20201214202117.146293-1-christophe.jaillet@wanadoo.fr/ >> are needed or not. >> --- >> kernel/irq/irqdomain.c | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c >> index 6aacd342cd14..d761ece8d43e 100644 >> --- a/kernel/irq/irqdomain.c >> +++ b/kernel/irq/irqdomain.c >> @@ -858,6 +858,15 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) >> } >> EXPORT_SYMBOL_GPL(irq_create_fwspec_mapping); >> >> +/** >> + * irq_create_of_mapping() - Map an interrupt > I think this deserves a bit more work. My immediate questions when > reading this are "map where? and to what?". I won't be of great help here. I don't know this code enough to be able to provide an accurate description. >> + * @irq_data: structure of_phandle_args returned by a previous >> + * of_irq_parse_xxx() call > That's not strictly true. A of_phandle_args structure can be created > from scratch (and numerous drivers do that). > >> + * >> + * The resources allocated by this function should be freed by >> + * calling irq_dispose_mapping() when the mapping if not useful >> + * anymore. > This really is a bit of documentation for irq_dispose_mapping(), isn't it? Well, I don't agree. I think it is easier to see that some resources need to be freed with a dedicated function if it is explained in the description of the function which allocates the resource. CJ > >> + */ >> unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) >> { >> struct irq_fwspec fwspec; > Thanks, > > M. >