diff options
author | James Clark <james.clark@arm.com> | 2023-05-09 10:49:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-30 21:07:15 +0100 |
commit | 9e6aa7c22d0777da16cec0d056382c9bd181aa78 (patch) | |
tree | cfb5120bf6ff4f61409740b964e860bfc443011e | |
parent | 7c054b2cbac388a86ed6a85b831c044a0325e150 (diff) | |
download | linux-9e6aa7c22d0777da16cec0d056382c9bd181aa78.tar.gz linux-9e6aa7c22d0777da16cec0d056382c9bd181aa78.tar.bz2 linux-9e6aa7c22d0777da16cec0d056382c9bd181aa78.zip |
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@huawei.com>
Signed-off-by: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20230509094942.396150-5-james.clark@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 8582479f0211..444c74eeab7d 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); |