Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2452286imm; Mon, 24 Sep 2018 04:45:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV61qKnkVXj55qAaRDS3mIoO9GBwchC1Zfxmd/cMFJsaYS8uiifVmUK5qCGDsc0idsx1yD5XY X-Received: by 2002:a63:2587:: with SMTP id l129-v6mr9213657pgl.29.1537789534095; Mon, 24 Sep 2018 04:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537789534; cv=none; d=google.com; s=arc-20160816; b=NB4TyIt9Rd+RvKJiebloIZ4I5RYTCssoRZvGVLRrr6D4dUIQt/tEBRpUQ0YUZXcxLt Vew39+gzfibafPMLHc2588M2HoO2nKM4rP8ASokd9tYmydBNsNmBp0WoHVoACln2i6Uv ZaEIig17a+5JbBdQtZpXxjis36KlWWKPfScE99gKuc1UTdeDB7nO7EtMQFnS0r9yHwDs 9gYQ2DIcB150ePxK5PL8l5vcT5Ddko3eyDuBKdGo9zl0E4JdIpIMUJLxiys0BGslt1Pl 50vvNuPI4vdzNBN2W4gCmZZORFBQ2eZRAFtQRN/4+tPhzzX3fVxk1cVlQeru9wZtn5px F7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=I+neKOGaIfxkYLq7/KSb4qMUPj20qwsj/r39saWB6Z0=; b=Yr9Ku0kElY8thqg9rwtk9+uMvOd8N6lbLpH3EotuC9mcLnKM3a5FVo2nz0ywhhlOoB tvy/WS59A90+mmcXVORu1MKh7GoazcsfcRZjkw/F2XwxWCkAD4uy73SZqYbJgGX04Ixf i4X/Ozclsc1Cf2IEqH3uwQmmNJipjmGNIfiG6yfNHfYd2Bq9pgiDmX+WI/BLe8nDrmS/ 3ZNwLX6afsMhN+po1hE14Ii5phvkfOPK0n92CY1dZzcYkc0Vs8aPDQanHNz/krEJ38T9 X8xa0AHh2A2FvBZifxY53r88BgPPAUIt2IRQ9a4Hb8JFX8yIvfbOhmzU83MqBUasnXVQ 2EcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=d+YBLdu+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k135-v6si2788544pfd.168.2018.09.24.04.45.18; Mon, 24 Sep 2018 04:45:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=d+YBLdu+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729483AbeIXRqM (ORCPT + 99 others); Mon, 24 Sep 2018 13:46:12 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:38143 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728958AbeIXRqL (ORCPT ); Mon, 24 Sep 2018 13:46:11 -0400 Received: by mail-it1-f196.google.com with SMTP id p129-v6so10035578ite.3 for ; Mon, 24 Sep 2018 04:44:31 -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:content-transfer-encoding; bh=I+neKOGaIfxkYLq7/KSb4qMUPj20qwsj/r39saWB6Z0=; b=d+YBLdu+otmsClkcGAkVQ373X4hsv1d7iH/yPqg3qy8+Hsx+Lz7XcirFMQfiqZITwN iLRkUM+EpWCrPiycJhAPs1kSXjQRu9ctiibeRD7QbLc7MFj+R9Zz9ziQxZpiSODcy/Q7 0n4ryC6qXYbA8BPI3kO9X6trp/1mcj68BiGx+1ZygcEcRWFb8Vq4W3b7LRZevfFuIneO LyeCp3P/+/r6hNx5TWpQVxlkL1XLU0rU/qJjTfwPmTzKPs/BZhXhJt8NGdorHlzsMYO2 wyg2hILCB+qWHMKNAz68xGqje7Msx/pXKXkb73bjQTUpFsWn2NUOJ7/JKmGNIhfVPjrn d90A== 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:content-transfer-encoding; bh=I+neKOGaIfxkYLq7/KSb4qMUPj20qwsj/r39saWB6Z0=; b=ee4DkPV1L6U5RL0EOwwVdfvRRmBdDEgY15q95c56lXF20XkdtS8Sz42CK8AGhfu48X uGQLWfaYqj1T4qpHLzCRq1jhYfmBtOPwUkVVgpdSyAx/tJabdX6GtWfKI6O5ucFXTGTw mWOdNtJ5adxw94fE9oXQs/bjHlRuW5NddvGsrmddQDa4bU9nIO6eqkny8NVGPFkHh3sM UKagWD31uFPftQI+KqJktDzT6SPgkHlJYstpyt15ZG52xala5nJ3wGPlE2M1nuoVh21F b7yJcmutbM44XsXCgbSKERZjjHvESqsTNmQxTmoYkGMkP+uU4LLFwdZa7Ud3QmnmzKS+ Wh4Q== X-Gm-Message-State: ABuFfojxhCUUn8q9oAFPlwU8jxcfiKW0sas3NgbibiKRxifRDfoTUc2E d1rp5KsZLwCXkTq8Gs6Y7RtrIFcwc7h+SvrpdrhRGw== X-Received: by 2002:a24:a20f:: with SMTP id j15-v6mr2121558itf.125.1537789470555; Mon, 24 Sep 2018 04:44:30 -0700 (PDT) MIME-Version: 1.0 References: <20180924101150.23349-1-brgl@bgdev.pl> <20180924101150.23349-5-brgl@bgdev.pl> <20180924112303.GM15943@smile.fi.intel.com> In-Reply-To: <20180924112303.GM15943@smile.fi.intel.com> From: Bartosz Golaszewski Date: Mon, 24 Sep 2018 13:44:19 +0200 Message-ID: Subject: Re: [PATCH v3 4/4] clk: pmc-atom: use devm_kstrdup_const() To: Andy Shevchenko Cc: Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , "Rafael J . Wysocki" , Arend van Spriel , Ulf Hansson , Bjorn Helgaas , Vivek Gautam , Robin Murphy , Joe Perches , Heikki Krogerus , Andrew Morton , Mike Rapoport , Michal Hocko , Al Viro , Jonathan Corbet , Roman Gushchin , Huang Ying , Kees Cook , Bjorn Andersson , Arnd Bergmann , linux-clk , Linux Kernel Mailing List , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pon., 24 wrz 2018 o 13:23 Andy Shevchenko napisa=C5=82(a): > > On Mon, Sep 24, 2018 at 12:11:50PM +0200, Bartosz Golaszewski wrote: > > Use devm_kstrdup_const() in the pmc-atom driver. This mostly serves as > > an example of how to use this new routine to shrink driver code. > > > > While we're at it: replace a call to kcalloc() with devm_kcalloc(). > > > @@ -352,8 +344,6 @@ static int plt_clk_probe(struct platform_device *pd= ev) > > goto err_drop_mclk; > > } > > > > - plt_clk_free_parent_names_loop(parent_names, data->nparents); > > - > > platform_set_drvdata(pdev, data); > > return 0; > > I don't think this is a good example. > > You changed a behaviour here in the way that you keep all chunks of memor= y > (even small enough for pointers) during entire life time of the driver, w= hich > pretty likely would be forever till next boot. > > In the original case the memory was freed immediately in probe either it = fails > or returns with success. > > NAK, sorry. > > I see. I'd like to still merge patches 1-3 and then I'd come up with better examples for the next release cycle once these are in? Bart