Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3130734pxk; Mon, 28 Sep 2020 09:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTb4hvil8U5Ca+M97cIL9u4BZn7A0wuZewKM+O8oWaX7Hd7kHrAeo+Hp0GVCjkNrfjoVVX X-Received: by 2002:a17:906:71c9:: with SMTP id i9mr2296230ejk.250.1601309059717; Mon, 28 Sep 2020 09:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601309059; cv=none; d=google.com; s=arc-20160816; b=wK2TO432Jewq/8BWpu0ALN9h3jlXIbByLfXG92x+tLmnH350yd2siqlo+N+PRQrW4X MnLf0oPTzTwvTPwsL1y5mQ9hXouCh4mwwwMhwV2ziUEn8wtSB4K7qSlsdlVmYI/nzIwl lXzvZCvzxdnjNh0mBqd2Ww3vJG+b55dVhuCv1eSsJlyud+DXDALBBh7nsdOqtTWZ59Iq +8e+Tjlppmzo6VdBGcTkBhHDPAWNN1fOBhyhQbg75S1iLCCnbSRxU/P9vebHm1Ipx67f P0Mv3O3Pg60UYrott2Slar8P4yseP9Y8OmIIejqEAV3qeLgPvUpL9zjfsOEGJeIcJVXq H4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Beb7AHySGsyjEGIYpYtOQgRUOc+Ox7Lq09Bf6qtNab8=; b=nLT9arZ1s23vZuYE9kPteWvIBF8Uc7B+1Pn/hTMGC+GEZlMxxIGgvFJCvjuYbKjbyU Ys/tB4A5840oJat7P8bD63aQLoEssnDoSj2KhCKYIwIrr8/Qmr67Yoy86muZuuX6n+cn KWl17e5eLkwZK+YYboNmccGXaUMEV6GYLYRSh3gi0iIWP+OIW3nefnskco03u+JRHUFE oWlaj9oTDsP5oZGUYQDGxhjo/xkU3grEK7qi9As7UQzbvvDmb5ic2ZBBV9GOQOv6tVnL s0czIVnAI7A7PQt5cZkBleTJmd29/KBzSalCU41PRhEbKlVjFJRnt2KDrhhotjA3qDZm Jnsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XLChYpb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si950584ejj.33.2020.09.28.09.03.55; Mon, 28 Sep 2020 09:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XLChYpb+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbgI1QCX (ORCPT + 99 others); Mon, 28 Sep 2020 12:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbgI1QCX (ORCPT ); Mon, 28 Sep 2020 12:02:23 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE3EC0613CE for ; Mon, 28 Sep 2020 09:02:21 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id g7so1630696iov.13 for ; Mon, 28 Sep 2020 09:02:21 -0700 (PDT) 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=Beb7AHySGsyjEGIYpYtOQgRUOc+Ox7Lq09Bf6qtNab8=; b=XLChYpb+lNHEqVKvw3ag/ZHYaGZefR52QZetHcKGbGil1brBqQgdflZhVGCCq9c7g0 xyEdBIyB8Hox+di1BXVXMW72/IUG6L9D+rFPyyvTEaWxI6BeRTfD1qqVBIFH6M4E+WG/ IBKdLMDXZSy6aYMFefJtcrSdSCORUwDgGNjCh+feqiEiVAzW4+v6/WTrZio8ukhIzxz7 gSB4P6mgH2IdJG8D8qzJtqCW4+dIch0jva42HuIVmaZc++NSBD4jFvEwCwYPMDgXu++W b9Lp9UmODqOaf70oOpyYrD7OXooaNhwzHuAACkfILlxO3/+uzQghf7LkRFKiDbyuzs1k /TxA== 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=Beb7AHySGsyjEGIYpYtOQgRUOc+Ox7Lq09Bf6qtNab8=; b=RAPUR5KBAZKsubKzfpZBrIOhJs2dsu6jDJLxl+3HnaWRB38tv2+KL5hEqROdv4bs/m NHwQPYrf6jnmWiuAbaTrS+NYcDUxI1NGFnMomKpXfOu+8NNCsQI3iAm529TQth15ZoY4 lxIlyZQpMXu9TCt9afbzPsjdBGjKzGQsli8NvxcVBfgmuab1OCIbVRKOe87JbgBQYS+F ga/ATdUDrTQGS9UPtz9Iq9L2yWz3nlu7zpiUhnqaUFv2WO2C107fUNAT8PjYjwIru5nd M90pUn1moQGZJYS8/Hsr5XdouhDfmC93dYMwMVM40iggU8NCdJkG/0uRXc62R1EwDU66 uS4A== X-Gm-Message-State: AOAM532gCLSjHLNSCsnGb/IuRPSkDCYopxpEA4BPv4M3Rxif25OaEw/Y TqeDG4beVnjf0CZ6l++cebXJ9cGmQlYBichxwE/zow== X-Received: by 2002:a05:6638:dc8:: with SMTP id m8mr336154jaj.102.1601308940843; Mon, 28 Sep 2020 09:02:20 -0700 (PDT) MIME-Version: 1.0 References: <20200928104155.7385-1-brgl@bgdev.pl> <20200928104155.7385-2-brgl@bgdev.pl> <2fcfd81f62ec87d9b75cca32468d8b9583faec47.camel@perches.com> In-Reply-To: <2fcfd81f62ec87d9b75cca32468d8b9583faec47.camel@perches.com> From: Bartosz Golaszewski Date: Mon, 28 Sep 2020 18:02:09 +0200 Message-ID: Subject: Re: [PATCH v2 1/9] lib: string_helpers: provide kfree_strarray() To: Joe Perches Cc: Linus Walleij , Jonathan Corbet , Andy Shevchenko , Kent Gibson , "open list:GPIO SUBSYSTEM" , linux-doc , Linux Kernel Mailing List , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 5:59 PM Joe Perches wrote: > > On Mon, 2020-09-28 at 12:41 +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > There's a common pattern of dynamically allocating an array of char > > pointers and then also dynamically allocating each string in this > > array. Provide a helper for freeing such a string array with one call. > > Isn't this also common for things like ring buffers? > Why limit this to char *[]? > I don't want to add APIs nobody is using. What do you suggest? Bartosz