* [PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning
@ 2020-10-31 3:05 YueHaibing
2020-11-02 8:20 ` Jiri Slaby
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-10-31 3:05 UTC (permalink / raw)
To: gregkh, jirislaby, yuehaibing; +Cc: linux-serial, linux-kernel
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>
---
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);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning
2020-10-31 3:05 [PATCH] serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning YueHaibing
@ 2020-11-02 8:20 ` Jiri Slaby
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2020-11-02 8:20 UTC (permalink / raw)
To: YueHaibing, gregkh; +Cc: linux-serial, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-02 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).