From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35115C63697 for ; Sat, 28 Nov 2020 16:01:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1680241A4 for ; Sat, 28 Nov 2020 16:01:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cdofitGW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rnm00mPi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1680241A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S2y0tl6EXMXTfM9ZLOLC3POh4c3s+OBSPKiMCwIqSKE=; b=cdofitGW2mHmpyN3LPAfJaY9A Di/lWHqcjlhtYmlVcWlXyk5M1jxPntGLjfv2jKoB4bedcu4IoU9dQjyVVbrDU00xs4f45n34MknKi XC5tnGSFUND9Mk9f5panl7sxGV2oXpJqTKWJlAgUX7TtCYPXTGJ4IO7hHLmtMH1iULFqlStvVtu/d mdlep0gKo7TCh58COF4GBolTwUEd7KJ/+qALnneWLWch3l/6tNnaSVA15aAIoF+8K5KIn76hC14qy rkfcf9eqIXXP3+6XE7rC/aBIPNBM6GMlJ4sYBgWMUAPwO3++xy1Wox/rSHy4bvPa53xS5VN0/e3aM TypQzyXrg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj2du-0008KB-DR; Sat, 28 Nov 2020 16:00:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kj2dq-0008Jq-Rv for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2020 16:00:08 +0000 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E766C246BC; Sat, 28 Nov 2020 16:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606579205; bh=tIKRhWls3YzYhbVGldXSkrWMmSCjQfXBQFEelNA1aWM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Rnm00mPizeX5NU8jciZzzV3em6AJ98QA8A5sG7mzGPah20ZRauHQ6W6P5B05yGeqh C0EyTSQjMtntaUCjrRaWhI+gtvOU07+MWkkFUSZnfCKj8G7zBaBgJ5wzIMA09DGmwi Cqi36nVkWJEB9aDGNWyJwHlTNVCU+5QquZH7qYBw= Date: Sat, 28 Nov 2020 16:00:00 +0000 From: Jonathan Cameron To: Bartosz Golaszewski Subject: Re: [PATCH v2 1/4] device: provide devm_krealloc_array() Message-ID: <20201128160000.5ac0ddc6@archlinux> In-Reply-To: References: <20201102142228.14949-1-brgl@bgdev.pl> <20201102142228.14949-2-brgl@bgdev.pl> <20201114154641.0258f4ee@archlinux> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_110007_240704_31126092 X-CRM114-Status: GOOD ( 34.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , linux-iio , Greg KH , Michal Simek , LKML , Bartosz Golaszewski , Peter Meerwald-Stadler , arm-soc Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 23 Nov 2020 12:38:26 +0100 Bartosz Golaszewski wrote: > On Mon, Nov 16, 2020 at 11:18 AM Bartosz Golaszewski > wrote: > > > > On Sat, Nov 14, 2020 at 5:16 PM Greg KH wrote: > > > > > > On Sat, Nov 14, 2020 at 03:46:41PM +0000, Jonathan Cameron wrote: > > > > On Mon, 2 Nov 2020 15:22:25 +0100 > > > > Bartosz Golaszewski wrote: > > > > > > > > > From: Bartosz Golaszewski > > > > > > > > > > When allocating an array of elements, users should check for > > > > > multiplication overflow or preferably use one of the provided helpers > > > > > like: devm_kmalloc_array(). > > > > > > > > > > This provides devm_krealloc_array() for users who want to reallocate > > > > > managed arrays. > > > > > > > > > > Signed-off-by: Bartosz Golaszewski > > > > > > > > +CC Greg KH. > > > > > > > > As this is going into a very generic place I'd like a relevant ack. > > > > That file is a bit of a wild west for acks, but Greg seems most > > > > appropriate person. > > > > > > > > So Greg, any comments on this one? > > > > > > As there is only 1 user of this function in the patch series, you don't > > > save any extra code space here, I don't think this is worth it. > > > > > > > It's worth it in that the overflow check before allocation doesn't > > seem to belong in a driver IMO but is a general check that should live > > in common code. > > > > > We are seeing less and less gains from these new devm_* additions, and > > > only more confusion and problems with them. So perhaps don't add this? > > > I don't think it is needed. > > > > > > > I think you're referring to the discussion on > > devm_platform_ioremap_resource()? I would argue that consolidation of > > common operations in helpers is rarely a bad thing but it's a > > discussion for another thread. > > > > I'm not too attached to this patch - if you think this should be > > dropped then fine, but I don't see how the name devm_krealloc_array() > > can confuse anyone. > > > > Greg: what's the final call on this? Reroll the series without this patch. If it turns out to be a good idea in the long run we can always bring it back, but for now it's blocking the rest of the series. Thanks, Jonathan > > Bartosz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel