[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a676fff0-1c44-57a7-f7fe-899530c08bc7@linux.intel.com>
Date: Tue, 2 Jan 2024 12:33:48 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
cc: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-serial <linux-serial@...r.kernel.org>
Subject: Re: [PATCH v1] serial: 8250_lpss: copy dma_param using
devm_kmemdup()
On Tue, 2 Jan 2024, Raag Jadav wrote:
> Use devm_kmemdup() helper to copy dma_param instead of doing it manually.
>
> Signed-off-by: Raag Jadav <raag.jadav@...el.com>
> ---
> drivers/tty/serial/8250/8250_lpss.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
> index 0e43bdfb7459..776ec1ef29d6 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
> @@ -287,17 +287,14 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port
> return 0;
> }
>
> - rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL);
> + rx_param = devm_kmemdup(dev, &lpss->dma_param, sizeof(*rx_param), GFP_KERNEL);
> if (!rx_param)
> return -ENOMEM;
>
> - tx_param = devm_kzalloc(dev, sizeof(*tx_param), GFP_KERNEL);
> + tx_param = devm_kmemdup(dev, &lpss->dma_param, sizeof(*tx_param), GFP_KERNEL);
> if (!tx_param)
> return -ENOMEM;
>
> - *rx_param = lpss->dma_param;
> - *tx_param = lpss->dma_param;
> -
> dma->fn = lpss8250_dma_filter;
> dma->rx_param = rx_param;
> dma->tx_param = tx_param;
>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
--
i.
Powered by blists - more mailing lists