Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5533178rwr; Tue, 9 May 2023 02:54:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43xjuyY8lgqY4JexGAw8+fC30DpPxqhP4+Gc6qjxsxcF1HX10AZBO8E+aDeTgOKqLrMVrw X-Received: by 2002:a05:6a20:3d1a:b0:101:5f22:b46d with SMTP id y26-20020a056a203d1a00b001015f22b46dmr1409511pzi.29.1683626083400; Tue, 09 May 2023 02:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683626083; cv=none; d=google.com; s=arc-20160816; b=CFcTxwEhSNb02ILipSAdTxamNijwIlGaEYnjhtqBS+6O4fv1zObEeLt3zj0LDXiRfS HNrOM0Hf9w6k1MqcZ16jbEkYKtaKYgNm0nV1tbNcH11m0FKC/XzephN1/BKESvD2L8wK D32Lo9k4rh3iHp8dJGVXhuiTbutxKohVvWrHJnD1h7U8qSa5L93mwWBgIONNqewN2yKp p7puMLU6ELvoIZ/9s0Kx9Vg9LZCN8+4THHWSgHN7b6O+I5KXFC4gDjWg2Lb5i0gyokht bgQ1WQ/atlTiJFn6s7P8DBOOvTatNM791IIrIWNMNyw+0Ds8sS7C3x7WwELscrmO4Hdb gaTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TLheebRotwWyj6X42DCN2X0BO7AhQALex1X4fHaIXHI=; b=wOHCCFR0NpeieAPCGvlVF8Vj0NrZ4T253/bmQk0O1umhzHsbJEHQOmu3GUTf+2o76i 5bTZMIr1FRCKPWxir9GY8vYXF5sktVRTwEs8oDkm2eurphW18lrVT2UvKPlzW0QUR0Ns 3CNHIkHVWkN/BaZt7Rx8CEvqIWyalBbw8aq0xt8r1vnkxxmlkQ0W5rsPqmmmRJeEvFVu fFL546ZWvuOfM9gitTdsa49i06vhP9Cm3/gtDt3h+ts/pSuIzhslHPUCo6vDjR0h05Wy umHxZJ0+AkDZ+3/WA29IjXjDTcfuq2fIPdHiNqWHavAbiXSE1790R4peakY048c+Y/MD xtyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a638448000000b00528b78ddc06si1120047pgd.455.2023.05.09.02.54.29; Tue, 09 May 2023 02:54:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235086AbjEIJup (ORCPT + 99 others); Tue, 9 May 2023 05:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbjEIJuP (ORCPT ); Tue, 9 May 2023 05:50:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E95BE7; Tue, 9 May 2023 02:50:14 -0700 (PDT) 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 CA1EA106F; Tue, 9 May 2023 02:50:58 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.83.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3C32C3F67D; Tue, 9 May 2023 02:50:10 -0700 (PDT) From: James Clark To: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Cc: linux@roeck-us.net, michal.simek@amd.com, Jonathan.Cameron@huawei.com, James Clark , Jonathan Corbet , Jean Delvare , Anand Ashok Dumbre , Jonathan Cameron , Lars-Peter Clausen , Andy Gross , Bjorn Andersson , Konrad Dybcio , 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 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 Message-Id: <20230509094942.396150-5-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230509094942.396150-1-james.clark@arm.com> References: <20230509094942.396150-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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/ Reviewed-by: Jonathan Cameron Signed-off-by: James Clark --- 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