All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: linux-kernel@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	linux-clk@vger.kernel.org,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jason Cooper" <jason@lakedaemon.net>,
	"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Gregory Clément" <gregory.clement@free-electrons.com>,
	nadavh@marvell.com, "Lior Amsalem" <alior@marvell.com>,
	"Tomasz Nowicki" <tn@semihalf.com>,
	"Grzegorz Jaszczyk" <jaz@semihalf.com>
Subject: Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration
Date: Fri, 23 Sep 2016 15:06:59 -0700	[thread overview]
Message-ID: <20160923220659.GL21232@codeaurora.org> (raw)
In-Reply-To: <CAPv3WKfDrtDDMPi4oBmpNN_+b4mvG6cVnZT7pNTo8tcNUyzwyA@mail.gmail.com>

On 09/24, Marcin Wojtas wrote:
> Hi Stephen,
> 
> 2016-09-23 23:47 GMT+02:00 Stephen Boyd <sboyd@codeaurora.org>:
> > On 09/21, Marcin Wojtas wrote:
> >> @@ -203,80 +202,75 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
> >>       if (ret)
> >>               return ret;
> >>
> >> -     cp110_clks = devm_kcalloc(&pdev->dev, sizeof(struct clk *),
> >> -                               CP110_CLK_NUM, GFP_KERNEL);
> >> -     if (!cp110_clks)
> >> -             return -ENOMEM;
> >> -
> >> -     cp110_clk_data = devm_kzalloc(&pdev->dev,
> >> -                                   sizeof(*cp110_clk_data),
> >> +     cp110_clk_data = devm_kcalloc(&pdev->dev, sizeof(*cp110_clk_data),
> >> +                                   sizeof(struct clk_hw *) * CP110_CLK_NUM,
> >>                                     GFP_KERNEL);
> >
> > This doesn't look right. Why are calloc()ing clk_hw_onecell_data this
> > way?
> 
> After some time, at a first sight it seems I should've used following:
> cp110_clk_data = devm_kzalloc(&pdev->dev, sizeof(*cp110_clk_data) +
>                                                     sizeof(struct
> clk_hw *) * CP110_CLK_NUM,
>                                                     GFP_KERNEL);
> 
> I'll re-check, but is that what you meant?

Yes that looks better.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration
Date: Fri, 23 Sep 2016 15:06:59 -0700	[thread overview]
Message-ID: <20160923220659.GL21232@codeaurora.org> (raw)
In-Reply-To: <CAPv3WKfDrtDDMPi4oBmpNN_+b4mvG6cVnZT7pNTo8tcNUyzwyA@mail.gmail.com>

On 09/24, Marcin Wojtas wrote:
> Hi Stephen,
> 
> 2016-09-23 23:47 GMT+02:00 Stephen Boyd <sboyd@codeaurora.org>:
> > On 09/21, Marcin Wojtas wrote:
> >> @@ -203,80 +202,75 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
> >>       if (ret)
> >>               return ret;
> >>
> >> -     cp110_clks = devm_kcalloc(&pdev->dev, sizeof(struct clk *),
> >> -                               CP110_CLK_NUM, GFP_KERNEL);
> >> -     if (!cp110_clks)
> >> -             return -ENOMEM;
> >> -
> >> -     cp110_clk_data = devm_kzalloc(&pdev->dev,
> >> -                                   sizeof(*cp110_clk_data),
> >> +     cp110_clk_data = devm_kcalloc(&pdev->dev, sizeof(*cp110_clk_data),
> >> +                                   sizeof(struct clk_hw *) * CP110_CLK_NUM,
> >>                                     GFP_KERNEL);
> >
> > This doesn't look right. Why are calloc()ing clk_hw_onecell_data this
> > way?
> 
> After some time, at a first sight it seems I should've used following:
> cp110_clk_data = devm_kzalloc(&pdev->dev, sizeof(*cp110_clk_data) +
>                                                     sizeof(struct
> clk_hw *) * CP110_CLK_NUM,
>                                                     GFP_KERNEL);
> 
> I'll re-check, but is that what you meant?

Yes that looks better.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-09-23 22:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  9:05 [PATCH v3 0/3] Armada 7k/8k CP110 system controller fixes Marcin Wojtas
2016-09-21  9:05 ` Marcin Wojtas
2016-09-21  9:05 ` [PATCH v3 1/3] clk: mvebu: fix setting unwanted flags in CP110 gate clock Marcin Wojtas
2016-09-21  9:05   ` Marcin Wojtas
2016-09-23 21:44   ` Stephen Boyd
2016-09-23 21:44     ` Stephen Boyd
2016-09-21  9:05 ` [PATCH v3 2/3] clk: mvebu: dynamically allocate resources in Armada CP110 system controller Marcin Wojtas
2016-09-21  9:05   ` Marcin Wojtas
2016-09-23 21:44   ` Stephen Boyd
2016-09-23 21:44     ` Stephen Boyd
2016-09-21  9:05 ` [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration Marcin Wojtas
2016-09-21  9:05   ` Marcin Wojtas
2016-09-23 21:47   ` Stephen Boyd
2016-09-23 21:47     ` Stephen Boyd
2016-09-23 22:00     ` Marcin Wojtas
2016-09-23 22:00       ` Marcin Wojtas
2016-09-23 22:06       ` Stephen Boyd [this message]
2016-09-23 22:06         ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160923220659.GL21232@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=alior@marvell.com \
    --cc=andrew@lunn.ch \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=jaz@semihalf.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tn@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.