lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160923220659.GL21232@codeaurora.org>
Date:   Fri, 23 Sep 2016 15:06:59 -0700
From:   Stephen Boyd <sboyd@...eaurora.org>
To:     Marcin Wojtas <mw@...ihalf.com>
Cc:     linux-kernel@...r.kernel.org,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>, linux-clk@...r.kernel.org,
        Michael Turquette <mturquette@...libre.com>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Jason Cooper <jason@...edaemon.net>,
        Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
        Gregory Clément 
        <gregory.clement@...e-electrons.com>, nadavh@...vell.com,
        Lior Amsalem <alior@...vell.com>,
        Tomasz Nowicki <tn@...ihalf.com>,
        Grzegorz Jaszczyk <jaz@...ihalf.com>
Subject: Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to
 clk_hw API and registration

On 09/24, Marcin Wojtas wrote:
> Hi Stephen,
> 
> 2016-09-23 23:47 GMT+02:00 Stephen Boyd <sboyd@...eaurora.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ