Skip to content

Commit 9e6aa7c

Browse files
James-A-Clarkgregkh
authored andcommitted
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>
1 parent 7c054b2 commit 9e6aa7c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,11 @@ static int setup_fifos(struct qcom_geni_serial_port *port)
10531053
(port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE;
10541054

10551055
if (port->rx_buf && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) {
1056+
/*
1057+
* Use krealloc rather than krealloc_array because rx_buf is
1058+
* accessed as 1 byte entries as well as 4 byte entries so it's
1059+
* not necessarily an array.
1060+
*/
10561061
port->rx_buf = devm_krealloc(uport->dev, port->rx_buf,
10571062
port->rx_fifo_depth * sizeof(u32),
10581063
GFP_KERNEL);

0 commit comments

Comments
 (0)