linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] amiserial: Drop duplicate NULL check in shutdown()
@ 2022-02-02 16:56 Andy Shevchenko
  2022-02-03  8:35 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-02-02 16:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel; +Cc: Andy Shevchenko

The free_page(addr), which becomes free_pages(addr, 0) checks addr
against 0. No need to repeat this check in the caller.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/amiserial.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 1e60dbef676c..533d02b38e02 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -538,10 +538,8 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
 	 */
 	free_irq(IRQ_AMIGA_VERTB, info);
 
-	if (info->xmit.buf) {
-		free_page((unsigned long) info->xmit.buf);
-		info->xmit.buf = NULL;
-	}
+	free_page((unsigned long)info->xmit.buf);
+	info->xmit.buf = NULL;
 
 	info->IER = 0;
 	amiga_custom.intena = IF_RBF | IF_TBE;
-- 
2.34.1


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

* Re: [PATCH v1 1/1] amiserial: Drop duplicate NULL check in shutdown()
  2022-02-02 16:56 [PATCH v1 1/1] amiserial: Drop duplicate NULL check in shutdown() Andy Shevchenko
@ 2022-02-03  8:35 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2022-02-03  8:35 UTC (permalink / raw)
  To: Andy Shevchenko, Greg Kroah-Hartman, linux-kernel

On 02. 02. 22, 17:56, Andy Shevchenko wrote:
> The free_page(addr), which becomes free_pages(addr, 0) checks addr
> against 0. No need to repeat this check in the caller.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

> ---
>   drivers/tty/amiserial.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
> index 1e60dbef676c..533d02b38e02 100644
> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> @@ -538,10 +538,8 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
>   	 */
>   	free_irq(IRQ_AMIGA_VERTB, info);
>   
> -	if (info->xmit.buf) {
> -		free_page((unsigned long) info->xmit.buf);
> -		info->xmit.buf = NULL;
> -	}
> +	free_page((unsigned long)info->xmit.buf);
> +	info->xmit.buf = NULL;
>   
>   	info->IER = 0;
>   	amiga_custom.intena = IF_RBF | IF_TBE;


-- 
js
suse labs

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

end of thread, other threads:[~2022-02-03  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 16:56 [PATCH v1 1/1] amiserial: Drop duplicate NULL check in shutdown() Andy Shevchenko
2022-02-03  8:35 ` 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).