mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <marc.zyngier@arm.com>,
	openrisc@lists.librecores.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init()
Date: Wed, 3 Jan 2018 23:41:29 +0900	[thread overview]
Message-ID: <20180103144129.GJ32243@lianli.shorne-pla.net> (raw)
In-Reply-To: <1514893639-70586-1-git-send-email-weiyongjun1@huawei.com>

On Tue, Jan 02, 2018 at 11:47:19AM +0000, Wei Yongjun wrote:
> In case of error, the function ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.

Thanks, I am not sure why I was using the *ERR*() macros.  2 questions:

 - How did you notice this?
 - Should I pull this in through my tree or do you have another route? i.e.
   Marc?

> Fixes: 9b54470afd83 ("irqchip: add initial support for ompic")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Stafford Horne <shorne@gmail.com>

-Stafford

> ---
>  drivers/irqchip/irq-ompic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c
> index cf6d0c4..400b119 100644
> --- a/drivers/irqchip/irq-ompic.c
> +++ b/drivers/irqchip/irq-ompic.c
> @@ -171,9 +171,9 @@ static int __init ompic_of_init(struct device_node *node,
>  
>  	/* Setup the device */
>  	ompic_base = ioremap(res.start, resource_size(&res));
> -	if (IS_ERR(ompic_base)) {
> +	if (!ompic_base) {
>  		pr_err("ompic: unable to map registers");
> -		return PTR_ERR(ompic_base);
> +		return -ENOMEM;
>  	}
>  
>  	irq = irq_of_parse_and_map(node, 0);
> 

  reply	other threads:[~2018-01-03 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 11:47 Wei Yongjun
2018-01-03 14:41 ` Stafford Horne [this message]
2018-01-04  3:56   ` weiyongjun (A)
2018-01-04  9:57     ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180103144129.GJ32243@lianli.shorne-pla.net \
    --to=shorne@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=openrisc@lists.librecores.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=tglx@linutronix.de \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®