Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2526777imm; Mon, 24 Sep 2018 05:58:26 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbjzc3mi2A6r2xzSRwwPH9QmA/B6EOGEbe6LhroEPdSdCSb3zItMCq4lR3v8YjpfO2rpu06 X-Received: by 2002:a62:3545:: with SMTP id c66-v6mr10236408pfa.63.1537793906241; Mon, 24 Sep 2018 05:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793906; cv=none; d=google.com; s=arc-20160816; b=CdGBXl2y3XmvOviZdVbEiDG5W7H+2ekyIPcqaqambj+cOka0ahe6yzXcd6AMzsOuxm k9Cm9+Bxxc+6Ma/37/RddYgZtuHylpN0gn3q3gCyAExbNoLUKjesht/lAwpwaql2kUpP vhSd8VQmAvX5ZwdaZY1BZq4lqztdzn4dh8wt3McdKGjxYS6XmsyQGrbSBHZ48JkMEAlX x65xTsDaIkP4ZmTZNMZWnt/Lh389lIbujmpg173g//sF9rfbWC9Oh9iATcpdriGPBImD E++fNAWgb0ZGzTh2HMu3tQIUs5NNXKKvfzK5rXY5zvuix7fQjyD5V/I2IyuoDVJXHIB2 5MTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=G5SoXTVQVhkILdKPvKAiK4zfRX24KKdBI1L9YhTcS3Q=; b=QEJBhY7azC/+SHuooBaAfH37ba/q52hKWp1F9/tSph37lwiHN8a5JCmdM1eO+WBe8f SGgLno9MDT+uBbjLHM0vrhn4AUSPNh97yhA2jlEKAaiSXO/5zttJg2HeHVwoaemkrTjN Y893k5mWCU0cf/Cb5SN6vYGK/DzOok/4LJlLk6+9ca9KhQ5xNY7XBTpqQdEgUUlIBGMT DT0HO5MvH9FVJkBUC370QK3fvQ4Xf4j32x1LAd5EvcyykB6N8MOs0mcXmGnXDmaWfVf0 4tWpPSsUYuTLWG0EHmgwAiZZZXn6ez3ig9fgfZfyPwK2enDPIA+F0rs7Ded6YiNoWeh/ NXOQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si3543150pgp.678.2018.09.24.05.58.11; Mon, 24 Sep 2018 05:58:26 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731152AbeIXSN4 (ORCPT + 99 others); Mon, 24 Sep 2018 14:13:56 -0400 Received: from mga02.intel.com ([134.134.136.20]:14173 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731118AbeIXSNz (ORCPT ); Mon, 24 Sep 2018 14:13:55 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 05:12:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,297,1534834800"; d="scan'208";a="72420377" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga007.fm.intel.com with ESMTP; 24 Sep 2018 05:11:41 -0700 Received: from andy by smile with local (Exim 4.91) (envelope-from ) id 1g4PiE-0002Zf-Bl; Mon, 24 Sep 2018 15:11:38 +0300 Date: Mon, 24 Sep 2018 15:11:38 +0300 From: Andy Shevchenko To: Bartosz Golaszewski 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 Subject: Re: [PATCH v3 4/4] clk: pmc-atom: use devm_kstrdup_const() Message-ID: <20180924121138.GN15943@smile.fi.intel.com> References: <20180924101150.23349-1-brgl@bgdev.pl> <20180924101150.23349-5-brgl@bgdev.pl> <20180924112303.GM15943@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 24, 2018 at 01:44:19PM +0200, Bartosz Golaszewski wrote: > pon., 24 wrz 2018 o 13:23 Andy Shevchenko > napisaƂ(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 *pdev) > > > 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 memory > > (even small enough for pointers) during entire life time of the driver, which > > 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? I'm fine with first three, though I can't come up with better example for you now. My previous comment solely to clk-pmc-atom code. -- With Best Regards, Andy Shevchenko