[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230509094942.396150-5-james.clark@arm.com>
Date: Tue, 9 May 2023 10:49:41 +0100
From: James Clark <james.clark@....com>
To: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org
Cc: linux@...ck-us.net, michal.simek@....com,
Jonathan.Cameron@...wei.com, James Clark <james.clark@....com>,
Jonathan Corbet <corbet@....net>,
Jean Delvare <jdelvare@...e.com>,
Anand Ashok Dumbre <anand.ashok.dumbre@...inx.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Jiri Slaby <jirislaby@...nel.org>, linux-doc@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-iio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, linux-serial@...r.kernel.org
Subject: [PATCH v4 4/4] serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array
Now that devm_krealloc_array is available, add a comment justifying not
changing this occurrence to avoid any future auto fixups.
Link: https://lore.kernel.org/all/20230318173402.20a4f60d@jic23-huawei/
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Signed-off-by: James Clark <james.clark@....com>
---
drivers/tty/serial/qcom_geni_serial.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 08dc3e2a729c..3a6cf762449f 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1053,6 +1053,11 @@ 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) {
+ /*
+ * Use krealloc rather than krealloc_array because rx_buf is
+ * accessed as 1 byte entries as well as 4 byte entries so it's
+ * not necessarily an array.
+ */
port->rx_buf = devm_krealloc(uport->dev, port->rx_buf,
port->rx_fifo_depth * sizeof(u32),
GFP_KERNEL);
--
2.34.1
Powered by blists - more mailing lists