From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v1 1/1] serial: core: Drop duplicate NULL check in uart_*shutdown()
Date: Fri, 4 Feb 2022 15:29:27 +0100 [thread overview]
Message-ID: <Yf04R+REP6WahIIr@kroah.com> (raw)
In-Reply-To: <20220202165648.5610-1-andriy.shevchenko@linux.intel.com>
On Wed, Feb 02, 2022 at 06:56:48PM +0200, 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 callers.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/tty/serial/serial_core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 57f472268b6d..59f93040d807 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -328,8 +328,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
> state->xmit.buf = NULL;
> spin_unlock_irqrestore(&uport->lock, flags);
>
> - if (xmit_buf)
> - free_page((unsigned long)xmit_buf);
> + free_page((unsigned long)xmit_buf);
> }
>
> /**
> @@ -1621,8 +1620,7 @@ static void uart_tty_port_shutdown(struct tty_port *port)
> state->xmit.buf = NULL;
> spin_unlock_irq(&uport->lock);
>
> - if (buf)
> - free_page((unsigned long)buf);
> + free_page((unsigned long)buf);
> }
>
> static void uart_wait_until_sent(struct tty_struct *tty, int timeout)
> --
> 2.34.1
>
What branch is this against? It fails to apply to my tty-next branch :(
next prev parent reply other threads:[~2022-02-04 14:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 16:56 [PATCH v1 1/1] serial: core: Drop duplicate NULL check in uart_*shutdown() Andy Shevchenko
2022-02-03 8:35 ` Jiri Slaby
2022-02-04 14:29 ` Greg Kroah-Hartman [this message]
2022-02-04 15:27 ` Andy Shevchenko
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=Yf04R+REP6WahIIr@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.