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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 41FBBC2D0A8 for ; Mon, 28 Sep 2020 16:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 022A52080C for ; Mon, 28 Sep 2020 16:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbgI1Q0E (ORCPT ); Mon, 28 Sep 2020 12:26:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:35109 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726504AbgI1Q0C (ORCPT ); Mon, 28 Sep 2020 12:26:02 -0400 IronPort-SDR: Jmjlcl25lrALz2Iz2PDZE0DAaT3cw+XzY3IipqIx0p/Wqdd5yjoaOfLPKx8LIxOJuma3vEmfu1 EOZFf6FyGlCQ== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="149687502" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="149687502" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 09:26:00 -0700 IronPort-SDR: 7WUTEIOsBwl7Mtrc/EUhBU8IQiM/MDuMZzeOLzaftBUODxSD8SKkGFTA1LMpXHKsBIWQTfVIrQ +rNf/ibAC4Vw== X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="311845174" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 09:25:57 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kMvyK-002c4D-G9; Mon, 28 Sep 2020 19:25:52 +0300 Date: Mon, 28 Sep 2020 19:25:52 +0300 From: Andy Shevchenko To: Joe Perches Cc: Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Kent Gibson , "open list:GPIO SUBSYSTEM" , linux-doc , Linux Kernel Mailing List , Bartosz Golaszewski Subject: Re: [PATCH v2 1/9] lib: string_helpers: provide kfree_strarray() Message-ID: <20200928162552.GX3956970@smile.fi.intel.com> References: <20200928104155.7385-1-brgl@bgdev.pl> <20200928104155.7385-2-brgl@bgdev.pl> <2fcfd81f62ec87d9b75cca32468d8b9583faec47.camel@perches.com> <12317bbc7712d96be8f52a3bf574e47628830191.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12317bbc7712d96be8f52a3bf574e47628830191.camel@perches.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 09:06:34AM -0700, Joe Perches wrote: > On Mon, 2020-09-28 at 18:02 +0200, Bartosz Golaszewski wrote: > > 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? > > Change the argument to void** and call it > > void kfree_array(void **array, int count); Bart, if you go for this, I'm fine. You may keep my tag. -- With Best Regards, Andy Shevchenko