amiserial: Drop duplicate NULL check in shutdown()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 2 Feb 2022 16:56:55 +0000 (18:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Feb 2022 14:42:53 +0000 (15:42 +0100)
The free_page(addr), which becomes free_pages(addr, 0) checks addr
against 0. No need to repeat this check in the caller.

Acked-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220202165655.5647-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/amiserial.c

index 1e60dbef676c8b5361d3edf5ac3e15fee7fb6326..533d02b38e02e57d64fc7192089d16a047b9e3f7 100644 (file)
@@ -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;