Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2445026imm; Mon, 24 Sep 2018 04:37:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZtQ260jImyX5178A3MxSu2WnKu2VsXinUbR5Tttd64NvY0XJnpgn0+IhVwSdzl4aP6ApRf X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr3270608pgn.341.1537789052665; Mon, 24 Sep 2018 04:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537789052; cv=none; d=google.com; s=arc-20160816; b=TygyLR2uTuqu1vx6JHBPXRFv58C1hCw+xPy6+rjp+JC8bkLLK+HycY1gkvgObqvkoU wcvev6IUOFZcnLiTQvG3e8S2Km3f2BZhASXWMcWGnodNyGZ/fs6lLhc0LNLzAnPDDuim G5kMW8YlOn9D6u4vgrCF7MrG3TID/7/4JJxWOYxdgLSaEyK4CgI3nx/DgmCxOULGISGJ 3ZtTzjhjEKg8O1ZK+NYydun8GctG+xsbmkrV487keisKa2HlG3Ywy4asGCOFMjrSTOlz pLSpdQvzRysJMBDOsVAXQUyZhG+WGbkXX4QcshYYkCFjnDFDNGr/LWDrkzH26KxnqfJ5 uOIA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vfU3CQhqRMI+60bvvkDUiBUd479hrI4Msj5uTSXyzuI=; b=tkCAhLd8aiqTtNY/4ypFVoS0SkhwLAY7r/Ys5JTDUF/Xn8FoHlxRS9/cQLkiO6yVS6 x1DArHYWNlCiq70hYx/eb9mtquy4BtvR8AX4Np5UL5dVcD1SZ7YuQYUl8MmGPCyNXvmF BI4tjTFSw3NPloi0dWAgoTAd9mC8u+oYMfqD1Y+SnVtiuw13oswmhnvOY2XuhYpGMClI 33bbScyW0V3aen6+5QhaFcjPNSPVnn8yFofmmENbf1n8iNFHF2ZDFSdXLYmtJey5HIPQ dQn4vOfW9WfJUEL3D0O3pLa+BbleQLSXrDxYrjm45pWbbx5nvRuB7ceIC9+WqLT8yipg Wqsw== 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 x3-v6si34025492pgo.542.2018.09.24.04.37.11; Mon, 24 Sep 2018 04:37:32 -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 S1727565AbeIXRYs (ORCPT + 99 others); Mon, 24 Sep 2018 13:24:48 -0400 Received: from mga02.intel.com ([134.134.136.20]:62721 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbeIXRYr (ORCPT ); Mon, 24 Sep 2018 13:24:47 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 04:23:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,297,1534834800"; d="scan'208";a="75728290" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2018 04:23:05 -0700 Received: from andy by smile with local (Exim 4.91) (envelope-from ) id 1g4OxD-0002Gt-6F; Mon, 24 Sep 2018 14:23:03 +0300 Date: Mon, 24 Sep 2018 14:23:03 +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@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 4/4] clk: pmc-atom: use devm_kstrdup_const() Message-ID: <20180924112303.GM15943@smile.fi.intel.com> References: <20180924101150.23349-1-brgl@bgdev.pl> <20180924101150.23349-5-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180924101150.23349-5-brgl@bgdev.pl> 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 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. -- With Best Regards, Andy Shevchenko