From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-serial <linux-serial@vger.kernel.org>
Subject: Re: [PATCH v1] serial: 8250_lpss: copy dma_param using devm_kmemdup()
Date: Tue, 2 Jan 2024 12:33:48 +0200 (EET) [thread overview]
Message-ID: <a676fff0-1c44-57a7-f7fe-899530c08bc7@linux.intel.com> (raw)
In-Reply-To: <20240102055006.27256-1-raag.jadav@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]
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@intel.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@linux.intel.com>
--
i.
next prev parent reply other threads:[~2024-01-02 10:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 5:50 [PATCH v1] serial: 8250_lpss: copy dma_param using devm_kmemdup() Raag Jadav
2024-01-02 10:33 ` Ilpo Järvinen [this message]
2024-01-02 12:05 ` Mika Westerberg
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=a676fff0-1c44-57a7-f7fe-899530c08bc7@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=raag.jadav@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox