From patchwork Mon Mar 6 15:27:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 660667 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5508FC6FA99 for ; Mon, 6 Mar 2023 15:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbjCFP2M (ORCPT ); Mon, 6 Mar 2023 10:28:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbjCFP16 (ORCPT ); Mon, 6 Mar 2023 10:27:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8285B30E9A; Mon, 6 Mar 2023 07:27:50 -0800 (PST) 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 A510E12FC; Mon, 6 Mar 2023 07:28:33 -0800 (PST) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A26133F71A; Mon, 6 Mar 2023 07:27:47 -0800 (PST) From: James Clark To: linux-kernel@vger.kernel.org Cc: James Clark , Jonathan Corbet , Guenter Roeck , 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 4/4] serial: qcom_geni: Use devm_krealloc_array Date: Mon, 6 Mar 2023 15:27:23 +0000 Message-Id: <20230306152723.3090195-5-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230306152723.3090195-1-james.clark@arm.com> References: <20230306152723.3090195-1-james.clark@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Now that it exists, use it instead of doing the multiplication manually. Signed-off-by: James Clark --- drivers/tty/serial/qcom_geni_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index d69592e5e2ec..23fc33d182ac 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1056,9 +1056,9 @@ 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) { - port->rx_buf = devm_krealloc(uport->dev, port->rx_buf, - port->rx_fifo_depth * sizeof(u32), - GFP_KERNEL); + port->rx_buf = devm_krealloc_array(uport->dev, port->rx_buf, + port->rx_fifo_depth, sizeof(u32), + GFP_KERNEL); if (!port->rx_buf) return -ENOMEM; }