lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Jul 2018 09:28:52 -0600
From:   Rob Herring <robh+dt@...nel.org>
To:     liu.xiang6@....com.cn
Cc:     Frank Rowand <frowand.list@...il.com>, devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        liuxiang_1999@....com
Subject: Re: [PATCH] of: irq: Add a helper function for irq_of_parse_and_map

On Sat, Jul 21, 2018 at 9:38 AM Liu Xiang <liu.xiang6@....com.cn> wrote:
>
> Implement a resource managed irq_of_parse_and_map function.

That is obvious from the diff. Why do you need this?

Anything that is a platform device should use platform_get_irq. The
mapping is created by the core Also, of_irq_get() is preferred over
irq_of_parse_and_map() for new users as it has better error return
handling.

>
> Signed-off-by: Liu Xiang <liu.xiang6@....com.cn>
> ---
>  drivers/of/irq.c       | 38 ++++++++++++++++++++++++++++++++++++++
>  include/linux/of_irq.h |  7 +++++++
>  2 files changed, 45 insertions(+)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 02ad93a..947fe41 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -45,6 +45,44 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
>  }
>  EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
>
> +static void devm_irq_dispose_mapping(struct device *dev, void *res)
> +{
> +       irq_dispose_mapping(*(unsigned int *)res);

We don't ref count creating mappings, so this would break for any shared irq.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ