Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp861384rwl; Sat, 25 Mar 2023 12:26:12 -0700 (PDT) X-Google-Smtp-Source: AKy350be6AyTo0BMHarCDeUc7u+YMp8nycWLYrhF1t/viOnDEgDfKdmNouaG/XvuSWBLWtLUzF/9 X-Received: by 2002:a17:906:16c3:b0:8b1:75a5:4a92 with SMTP id t3-20020a17090616c300b008b175a54a92mr6753565ejd.72.1679772371781; Sat, 25 Mar 2023 12:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679772371; cv=none; d=google.com; s=arc-20160816; b=iTSenH/rH5983fsZRBy4hWa5huBJhYaAUkcKZP9adtWRHyz+54IFRoB0by9NyRcid8 9gW+EDOZoR9e9pXRem8YSC/HZ4MQDuccjNBWGHd/VAmD6FXYOm7pP2YKxx3pdPPoGeyt UmsYl0dSqzlMmzIBfwyvMpg4e3f5WMrlReNM69IefpK1IhCZx4u8Gwg/QVtexynFA1ju 5IQobXjf5fZwoiGQNkiX3Suby5LZmcDxyojpxXflTQkdPnox/fv2yf8dxnmltDe5P89H QytXAK71h4nUTg2tcAky8tcDC+t1i+SuIwv993ZXXWERbimsoSYVe115TK3bnwFy5Kcb ylzQ== 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:subject:cc:to:from:date :dkim-signature; bh=AHVFwuXbzmegQWygA85VbqT4C6/5a/re/S0GSKIhVSM=; b=riBsntjFAffSg6Z9zrVkKbkxCp9VFcmyJDt+ciSRuqcp5120/V7xzd/TTrbRJNv9o+ XsdhmrGducaVXjc0a5FyUvlkW9wdN8Bor+pdl2Kq1/AqEPkr6jPn99g9sgLqk4CbZf5v Lz7p42Ue7g2MeFBS2aj5HYbgZ1q0exMtP68zBd4qWN/6H5/JiSIB5j3RNzMr1YrNGhY0 KMAieUX3ASaJrdTcYLNIEHw6il7IlswMo151RBeVyezYfZU3pWGhIYdkdq9DOMcFu3ts PmDk8gFipqFX59F8Fxwb3R+eLYXF7HHTMKd2Bhau6vQ0EwAuXknB7v3n4ZQJoZqSB9G1 YvwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQRaY0Sd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz18-20020a170906f2d200b0093f220a3f1fsi2007244ejb.626.2023.03.25.12.25.47; Sat, 25 Mar 2023 12:26:11 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQRaY0Sd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbjCYS7b (ORCPT + 99 others); Sat, 25 Mar 2023 14:59:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjCYS7a (ORCPT ); Sat, 25 Mar 2023 14:59:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46ACF5276; Sat, 25 Mar 2023 11:59:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E3FEDB80782; Sat, 25 Mar 2023 18:59:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD1DAC433EF; Sat, 25 Mar 2023 18:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679770766; bh=cvkDQ5VUSugi/Mx0cXn8GHD+HIhy+RhvFVUaPPEbIaA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uQRaY0SdvHsMw3Qz1+oQ2OU67uhbpMc7NB4AyXGTJ/vep30XWbPOqxbW3fg1+ojV7 u34Y4IGvGvMqEtc+iLwpwoTEuXWcGUAMUFnV4umx8fuJI/ian4Ct+25DM5Hw7wsZD1 YCqfBlyPp/njAWIl8h2dhWigJZxZqHb1TOpTn3rGnreTCcepKTiFfZpaYBRj8SdtW3 7CpscxCm13XMUTxOgl7D5w3IG+8/oWhQl6wla27yb3TaNTBgy6GM1kvwNftE35OWZ7 ZGnP2ZtMyFSJiS4krHyoeBCpP7ehAbQarDoYa/F5JY5S3eGZ/zsYlUVhDwT3HI2G86 jkBrUKeIdDG5Q== Date: Sat, 25 Mar 2023 19:14:26 +0000 From: Jonathan Cameron To: James Clark Cc: linux-kernel@vger.kernel.org, linux@roeck-us.net, michal.simek@amd.com, Jonathan.Cameron@huawei.com, Jonathan Corbet , Jean Delvare , Anand Ashok Dumbre , 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: Re: [PATCH v3 4/4] serial: qcom_geni: Comment use of devm_krealloc rather than devm_krealloc_array Message-ID: <20230325191426.5810b644@jic23-huawei> In-Reply-To: <20230320145710.1120469-5-james.clark@arm.com> References: <20230320145710.1120469-1-james.clark@arm.com> <20230320145710.1120469-5-james.clark@arm.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 On Mon, 20 Mar 2023 14:57:09 +0000 James Clark wrote: > 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 LGTM 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);