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-next>] [day] [month] [year] [list]
Date:	Mon, 18 May 2015 11:15:42 +0200
From:	Jens Kuske <jenskuske@...il.com>
To:	Chen-Yu Tsai <wens@...e.org>
CC:	VishnuPatekar <vishnupatekar0510@...il.com>,
	Rob Herring <robh+dt@...nel.org>, linux-kernel@...r.kernel.org,
	Mike Turquette <mturquette@...aro.org>,
	devicetree@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	linux-arm-kernel@...ts.infradead.org, linux-sunxi@...glegroups.com,
	Emilio López <emilio@...pez.com.ar>
Subject: Re: [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor
 clock name from devicetree

Hi,

On 05/16/15 04:10, Chen-Yu Tsai wrote:
> 2015年5月16日 上午12:39於 "Jens Kuske" <jenskuske@...il.com>寫道:
[..]
>> @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct
> device_node *node,
>>         struct clk_gate *gate = NULL;
>>         struct clk_fixed_factor *fix_factor;
>>         struct clk_divider *divider;
>> +       struct factors_data factors = *data->factors;

Isn't this a copy?

>>         void __iomem *reg;
>>         int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
>>         int flags, clkflags;
>> @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct
> device_node *node,
>>         if (data->ndivs)
>>                 ndivs = data->ndivs;
>>
>> +       /* Try to find a name for base factor clock */
>> +       for (i = 0; i < ndivs; i++) {
>> +               if (data->div[i].self) {
>> +                       of_property_read_string_index(node,
> "clock-output-names",
>> +                                                     i, &factors.name);
> 
> Please excuse the bad formatting.
> I'm at the airport without my laptop.
> 
> This will not work. All the static factors_data structs are const.
> You should make a copy of it, maybe on the stack,
> update the .name field, and pass that to sunxi_factors_clk_setup().
> 

If I didn't miss anything, or misunderstood what you want to copy, this
should be working fine.

Jens

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ