linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: YueHaibing <yuehaibing@huawei.com>, gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning
Date: Mon, 2 Nov 2020 09:20:34 +0100	[thread overview]
Message-ID: <e8d9c560-dfd4-8419-a768-6a832114e7ea@kernel.org> (raw)
In-Reply-To: <20201031030530.1304-1-yuehaibing@huawei.com>

On 31. 10. 20, 4:05, YueHaibing wrote:
> drivers/tty/serial/serial_mctrl_gpio.c:214
>   mctrl_gpio_init() warn: passing zero to 'ERR_PTR'
> 
> gpiod_to_irq() never return 0, so remove the useless test
> and make code more clear.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/serial/serial_mctrl_gpio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c
> index fb4781292d40..c41d8911ce95 100644
> --- a/drivers/tty/serial/serial_mctrl_gpio.c
> +++ b/drivers/tty/serial/serial_mctrl_gpio.c
> @@ -207,7 +207,7 @@ struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx)
>   			continue;
>   
>   		ret = gpiod_to_irq(gpios->gpio[i]);
> -		if (ret <= 0) {
> +		if (ret < 0) {
>   			dev_err(port->dev,
>   				"failed to find corresponding irq for %s (idx=%d, err=%d)\n",
>   				mctrl_gpios_desc[i].name, idx, ret);
> 


-- 
js
suse labs

      reply	other threads:[~2020-11-02  8:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  3:05 [PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning YueHaibing
2020-11-02  8:20 ` Jiri Slaby [this message]

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=e8d9c560-dfd4-8419-a768-6a832114e7ea@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=yuehaibing@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;
as well as URLs for NNTP newsgroup(s).