From patchwork Wed Sep 14 21:33:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9332553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 605D26077F for ; Wed, 14 Sep 2016 21:50:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50C192A004 for ; Wed, 14 Sep 2016 21:50:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42E982A01E; Wed, 14 Sep 2016 21:50:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684992A004 for ; Wed, 14 Sep 2016 21:50:20 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7E7BC266E3E; Wed, 14 Sep 2016 23:50:19 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E0CFD2664C3; Wed, 14 Sep 2016 23:48:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5C7CE266E38; Wed, 14 Sep 2016 23:33:28 +0200 (CEST) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id AF9132664FB for ; Wed, 14 Sep 2016 23:33:26 +0200 (CEST) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C706161B03; Wed, 14 Sep 2016 21:33:25 +0000 (UTC) Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 54CBD61AE0; Wed, 14 Sep 2016 21:33:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 54CBD61AE0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sboyd@codeaurora.org Date: Wed, 14 Sep 2016 14:33:24 -0700 From: Stephen Boyd To: Irina Tirdea Message-ID: <20160914213324.GF7243@codeaurora.org> References: <1473427417-9166-1-git-send-email-irina.tirdea@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1473427417-9166-1-git-send-email-irina.tirdea@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: alsa-devel@alsa-project.org, Michael Turquette , Takashi Iwai , Pierre-Louis Bossart , Mark Brown , linux-clk@vger.kernel.org, Pierre-Louis Bossart Subject: Re: [alsa-devel] [PATCH v3] clk: x86: Add Atom PMC platform clocks X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On 09/09, Irina Tirdea wrote: > + > +static const char **plt_clk_register_parents(struct platform_device *pdev, > + struct clk_plt_data *data, > + const struct pmc_clk *clks) > +{ > + const char **parent_names; > + int i, err; > + > + data->nparents = 0; > + while (clks[data->nparents].name) > + data->nparents++; > + > + data->parents = devm_kzalloc(&pdev->dev, > + sizeof(*data->parents) * data->nparents, > + GFP_KERNEL); This could be devm_kcalloc() ---8<---- diff --git a/drivers/clk/x86/clk-byt-plt.c b/drivers/clk/x86/clk-byt-plt.c index 9dbf4b04ae47..7bd6c0dded00 100644 --- a/drivers/clk/x86/clk-byt-plt.c +++ b/drivers/clk/x86/clk-byt-plt.c @@ -259,9 +259,8 @@ static const char **plt_clk_register_parents(struct platform_device *pdev, while (clks[data->nparents].name) data->nparents++; - data->parents = devm_kzalloc(&pdev->dev, - sizeof(*data->parents) * data->nparents, - GFP_KERNEL); + data->parents = devm_kcalloc(&pdev->dev, data->nparents, + sizeof(*data->parents), GFP_KERNEL); if (!data->parents) { err = -ENOMEM; goto err_out;