lkml.org 
[lkml]   [2023]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 4/4] serial: qcom_geni: Use devm_krealloc_array
Date
Now that it exists, use it instead of doing the multiplication manually.

Signed-off-by: James Clark <james.clark@arm.com>
---
drivers/tty/serial/qcom_geni_serial.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index d69592e5e2ec..23fc33d182ac 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1056,9 +1056,9 @@ static int setup_fifos(struct qcom_geni_serial_port *port)
(port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE;

if (port->rx_buf && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) {
- port->rx_buf = devm_krealloc(uport->dev, port->rx_buf,
- port->rx_fifo_depth * sizeof(u32),
- GFP_KERNEL);
+ port->rx_buf = devm_krealloc_array(uport->dev, port->rx_buf,
+ port->rx_fifo_depth, sizeof(u32),
+ GFP_KERNEL);
if (!port->rx_buf)
return -ENOMEM;
}
--
2.34.1
\
 
 \ /
  Last update: 2023-03-27 00:52    [W:0.070 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site