linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] tty:serial:mvebu-uart:fix a wrong return
@ 2020-03-03  7:13 tangbin
  2020-03-03  7:57 ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: tangbin @ 2020-03-03  7:13 UTC (permalink / raw)
  To: gregkh; +Cc: jslaby, linux-serial, linux-kernel, tangbin

in this place,the right return should be
return PTR_ERR(),not return -PTR_ERR()

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
---
 drivers/tty/serial/mvebu-uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index c12a12556..4e9a59071 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -851,7 +851,7 @@ static int mvebu_uart_probe(struct platform_device *pdev)
 
 	port->membase = devm_ioremap_resource(&pdev->dev, reg);
 	if (IS_ERR(port->membase))
-		return -PTR_ERR(port->membase);
+		return PTR_ERR(port->membase);
 
 	mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),
 			      GFP_KERNEL);
-- 
2.20.1.windows.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] tty:serial:mvebu-uart:fix a wrong return
  2020-03-03  7:13 [PATCH 2/2] tty:serial:mvebu-uart:fix a wrong return tangbin
@ 2020-03-03  7:57 ` Jiri Slaby
       [not found]   ` <202003041737399757401@cmss.chinamobile.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2020-03-03  7:57 UTC (permalink / raw)
  To: tangbin, gregkh; +Cc: linux-serial, linux-kernel

On 03. 03. 20, 8:13, tangbin wrote:
> in this place,the right return should be
> return PTR_ERR(),not return -PTR_ERR()

One because missing. Like ", because PTR_ERR already returns a negative
error and the probe function is expected to return a negative value in
case of error."

Acked-by: Jiri Slaby <jslaby@suse.cz>

> Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
> ---
>  drivers/tty/serial/mvebu-uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
> index c12a12556..4e9a59071 100644
> --- a/drivers/tty/serial/mvebu-uart.c
> +++ b/drivers/tty/serial/mvebu-uart.c
> @@ -851,7 +851,7 @@ static int mvebu_uart_probe(struct platform_device *pdev)
>  
>  	port->membase = devm_ioremap_resource(&pdev->dev, reg);
>  	if (IS_ERR(port->membase))
> -		return -PTR_ERR(port->membase);
> +		return PTR_ERR(port->membase);
>  
>  	mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),
>  			      GFP_KERNEL);
> 


-- 
js
suse labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] tty:serial:mvebu-uart:fix a wrong return
       [not found]   ` <202003041737399757401@cmss.chinamobile.com>
@ 2020-03-04 10:07     ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2020-03-04 10:07 UTC (permalink / raw)
  To: 唐彬, gregkh; +Cc: linux-serial, linux-kernel

On 04. 03. 20, 10:37, 唐彬 wrote:
>      I'm very happy for your replay. But I don't understand, in this
> place ,it's function is to judge.You say 'the probe function is expected
> to return a negative value in case of error'?But at the top or bottom
> of the code here in mvebu_uart_probe(),there are a lot of judgments
> that return negative numbers. How do you explain that?

That's exactly the point. The function should return a negative value
and PTR_ERR already returns a negative.

That is, your patch is correct, but your commit message missed an
explanation.

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-04 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03  7:13 [PATCH 2/2] tty:serial:mvebu-uart:fix a wrong return tangbin
2020-03-03  7:57 ` Jiri Slaby
     [not found]   ` <202003041737399757401@cmss.chinamobile.com>
2020-03-04 10:07     ` 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).