All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org
Cc: linux@roeck-us.net, michal.simek@amd.com,
	Jonathan.Cameron@huawei.com, James Clark <james.clark@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Jean Delvare <jdelvare@suse.com>,
	Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-doc@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org
Subject: [PATCH v4 4/4] serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array
Date: Tue,  9 May 2023 10:49:41 +0100	[thread overview]
Message-ID: <20230509094942.396150-5-james.clark@arm.com> (raw)
In-Reply-To: <20230509094942.396150-1-james.clark@arm.com>

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>
---
 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


      parent reply	other threads:[~2023-05-09  9:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  9:49 [PATCH v4 0/4] devres: Provide krealloc_array James Clark
2023-05-09  9:49 ` [PATCH v4 1/4] " James Clark
2023-05-13 11:04   ` Greg KH
2023-05-15  7:55     ` James Clark
2023-05-15 11:55       ` Greg KH
2023-05-15 11:55         ` Greg KH
2023-05-31 22:44         ` Suzuki K Poulose
2023-05-31 22:44           ` Suzuki K Poulose
2023-05-31 22:47           ` Suzuki K Poulose
2023-05-31 22:47             ` Suzuki K Poulose
2023-06-01  9:33           ` Greg KH
2023-06-01  9:33             ` Greg KH
2023-06-01  9:52             ` Suzuki K Poulose
2023-06-01  9:52               ` Suzuki K Poulose
2023-06-05 13:39               ` Suzuki K Poulose
2023-06-05 13:39                 ` Suzuki K Poulose
2023-06-05 15:20                 ` Greg KH
2023-06-05 15:20                   ` Greg KH
2023-06-05 15:59                   ` Suzuki K Poulose
2023-06-05 15:59                     ` Suzuki K Poulose
2023-05-09  9:49 ` [PATCH v4 2/4] hwmon: pmbus: Use devm_krealloc_array James Clark
2023-05-09  9:49 ` [PATCH v4 3/4] iio: adc: " James Clark
2023-05-09  9:49 ` James Clark [this message]

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=20230509094942.396150-5-james.clark@arm.com \
    --to=james.clark@arm.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=agross@kernel.org \
    --cc=anand.ashok.dumbre@xilinx.com \
    --cc=andersson@kernel.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=jic23@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=michal.simek@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.