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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E1755C388F9 for ; Mon, 23 Nov 2020 11:39:17 +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 7D5CB20738 for ; Mon, 23 Nov 2020 11:39:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g5+/EFnK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="1dh8p7k1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D5CB20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gDtDvSz5ehgSAMxTuATm6SLawWq7kxf7lTnS0+Z7Exc=; b=g5+/EFnKlPukfeemPEaNaEDeV xXVgl28jZc9RbfL6/xUVYkqeG0CIpCY7ixrVwB0ca58m5tu49Yq5/CKgBNtSrgdirNdw8I+qANGua RPbbgvePD7MvnBZtyEZ1af4rTaTMbTU600pkbnllBDwKMPlZmG2xVymjn+52NfYta8Pxp7Iq6CMMV Vesh5p+xH1xcYzSe2sIeCgQMkOcSAMLgWxb6YRz9gnTsp9S2AHG0RgOpTV30WQkOVFKIb8SjlXag/ leXrqyX+nCIH+ELL4GSDL8Mi8c0BhWDYq+tiMZxQEGuOlMhLXUSXNg8TEzhWTsRqKlflX77dHrPp/ FH9iOK1iw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khABD-00031e-HS; Mon, 23 Nov 2020 11:38:47 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khABB-00030X-Fn for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 11:38:46 +0000 Received: by mail-io1-xd41.google.com with SMTP id t8so17729853iov.8 for ; Mon, 23 Nov 2020 03:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GscDJuhiDYI0PonAMJ4n7EEJ+sUn5W7V85jdZ6urdyk=; b=1dh8p7k1lp5Ds+jtM8I2xKmjzfCV2nUm9U7Q2iHBD+hmnc9+Pfeh8G1ZLeiWBfLH9n LeuZkM63PluEhWUJndYfAhGLehyiMD3N5N9t8dQfPa/AcRgZLxte0xKKQJk1fUaDJcsU 9XJLiPbEJPLg2JAQs1Y5ORIBzBYNBC6L6uBgIk6FhEFNEs0y6HM6ezYGBQyjktXPSHfP OvBql+tOL4ZaY6Q/HvbXw8jPZlBlUlSw/LJl27oe13JpZqPvbUcMOt9MEAeikEz/ZqRJ XaaBLISvJ6oOAPHdv/0mZWZyKP5EM3iTI4FQY9yLTeYxJ7mZwoxEWu6jUHYjffvMdjKG pjLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GscDJuhiDYI0PonAMJ4n7EEJ+sUn5W7V85jdZ6urdyk=; b=R1AcWq6o2B1zGL/Bhvgj0oxGN5vUs8IV8ZgDWLPerGGoZEk376YK3+opgFDSUblADG eodr+9FTtcmzMQhnFUJOwZICwO/7vwcAu8UgULnLwnQ+/sEl4LS5mtudjMDWMPxEgJC3 0xQSysKgwax1QNy3wDNy6hRWftiEV8IcPIarOsW24uyJOhT7bJPUgNcMvepiIwYBKwVe 4PmU6s3wNC3ATj130oPdrf53oKHgrngZSTNrn0O/akRdOf0we2DLVZtqaK10XnJImIbY eaNCUyAElDVOBtUBIa9NZJcymq7RGyiJxEroITora+5I2MBdKiHCzUUrAjvisgywL/MX ud8w== X-Gm-Message-State: AOAM530oluu7MYVC6SKyk5FXiUcQM2PgKJmKu/L4G2+6QRveU6dsP/DT AC31cYY74VFI5wek6PduRrnq7smjhs/CRu2/ysOKCQ== X-Google-Smtp-Source: ABdhPJxYKrJ4ncImo3X/nb2XBn1D0r+PZcMWSmOulu8MZ7PU7Ly4pPaaJJMb86y4tbDTR9F/OzpLPXTCvE369c77RHc= X-Received: by 2002:a05:6638:ca2:: with SMTP id x2mr5490033jad.136.1606131517077; Mon, 23 Nov 2020 03:38:37 -0800 (PST) MIME-Version: 1.0 References: <20201102142228.14949-1-brgl@bgdev.pl> <20201102142228.14949-2-brgl@bgdev.pl> <20201114154641.0258f4ee@archlinux> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 23 Nov 2020 12:38:26 +0100 Message-ID: Subject: Re: [PATCH v2 1/4] device: provide devm_krealloc_array() To: Bartosz Golaszewski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_063845_666177_B9E82090 X-CRM114-Status: GOOD ( 30.25 ) 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 , arm-soc , Peter Meerwald-Stadler , Jonathan Cameron 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, 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? Bartosz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel