Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3149182pxk; Mon, 28 Sep 2020 09:29:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztto2/a/KhrYwDCiyLEW1PQpPrtxRsqu4hn8g6O4oUb6AETsIVUqKpcJ+nE0Fm1eawDWhZ X-Received: by 2002:a17:907:aa9:: with SMTP id bz9mr2352722ejc.421.1601310581729; Mon, 28 Sep 2020 09:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601310581; cv=none; d=google.com; s=arc-20160816; b=lKM7yD7jK5h6hQNQ555cDwl8WbL5Na2cjmbp+xnotEY+v2vOqUMuJSPNtIVr6yjIHQ tInXmkrVepR+xKjT6dZCFDCkqjvVvtLNuqN6l4OIbc6dk35dhayX+tIzHBDk9x9dPhvW gMYM+SuSRO+2F+6IGg08cg0E5A3sigmY+Tb7YxNeRYc88cSjsXIRX5cm5nK3ATZbbM7X BrE1CkizRJY7AwWone0qVqXjmNW0uCfSWwe1cCdQA1nz39lmawx9BKQEjpcj5oL0735B DzanzPqjVt4V5QuJQxHusi06jh5HGbfLf19EQvnrZlEoPpj4w8wS1myrhJRGs+/Zh9IJ 63yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=mPc5Hgpu8ejPIhtRoGGI0PTi/FbiNnJ8pQ7Hpbi9akk=; b=eu4gNSPgLmeeStQhFefQE7Acx9DPunUNR7ZWk4JPkIezmcWNKhZw2oYvZpTOQvV8Y/ W3Rmj2trxX2C3xS4bZLHBhwKhEavg6v2RJrGuXatjuJcQNp1fJW1Krr1QKmCqSQ8mi47 5ToTUMwBZR87xktf0phxE5RliqC9QqxBPSO8ManBlyKqFjI7NePYSPgvg7/m3yng8Leu 9JK0mh504CZypIRqOOgI8Nz0HnxC1jAzglhjWLRMlI6bJGpDyjOx333jk2uGDAg7CVwq fmxLj51uyf+zfF4dkzmBdrN174SuDXT937nDVrgRkXdlgoiFGkZ6G/PVGD7ToSsIAovg gyNA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si957675edr.568.2020.09.28.09.29.18; Mon, 28 Sep 2020 09:29:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbgI1Q0D (ORCPT + 99 others); Mon, 28 Sep 2020 12:26:03 -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