From patchwork Mon Mar 20 14:57:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13181407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6301C7618D for ; Mon, 20 Mar 2023 14:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3bLUIP6I4VOIdW6c+p4lu5KKpGozCGxdRQcV/FOUCIE=; b=Cb+LWJuY+/eWRM JxYHPfLulfl+/OuIxflj2gLKoJA/douNnkNV8R3ji3WupzXlCUUoilpHYJKNc21QA/5ZyPwnezXC8 kTdvuuqEjvY1Pnq1P7ojfXx5oE69lNgxUK09WDTBKB2mWQYPDT/HZvcciFWTUuRsCT82xyglLc2nE q9vqjUbVKiz3wpoQSHXv5J8bZK6bhSTVZHeq/y2UTWFZ45VIKuY8Y/N1SuT4vxRErM07KQj6YgGeX /jGc55hrMmEcnykAVupc95u2DaWkfgMsmXXKj6y3bdkdxghBYoWzDbTAWdn3MNmTDT/ylzsNX5kwo NXVp5fdtlJInxWo7gMNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peGxL-009QSF-1x; Mon, 20 Mar 2023 14:57:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peGx5-009QIR-23 for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2023 14:57:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 47E521063; Mon, 20 Mar 2023 07:58:18 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.18.95]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2FEC73F71E; Mon, 20 Mar 2023 07:57:31 -0700 (PDT) From: James Clark To: linux-kernel@vger.kernel.org, linux@roeck-us.net, michal.simek@amd.com, Jonathan.Cameron@huawei.com Cc: James Clark , Jonathan Corbet , Jean Delvare , Anand Ashok Dumbre , Jonathan Cameron , Lars-Peter Clausen , Michal Simek , Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , 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 v3 4/4] serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array Date: Mon, 20 Mar 2023 14:57:09 +0000 Message-Id: <20230320145710.1120469-5-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320145710.1120469-1-james.clark@arm.com> References: <20230320145710.1120469-1-james.clark@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230320_075735_744473_EEA37D12 X-CRM114-Status: UNSURE ( 9.22 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/ Signed-off-by: James Clark Reviewed-by: Jonathan Cameron --- 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 28fbc927a546..8ae1fb7c2636 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1055,6 +1055,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);