lkml.org 
[lkml]   [2018]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v9 02/12] drivers: base: cacheinfo: setup DT cache properties early
From
Date


On 18/05/18 22:50, Andy Shevchenko wrote:
> On Thu, May 17, 2018 at 6:47 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>> Is below patch does what you were looking for ?
>
> Somewhat.
> See below for some minors.
>

Thanks

>> of_property_read_u64 searches for a property in a device node and read
>> a 64-bit value from it. Instead of using of_get_property to get the
>> property and then read 64-bit value using of_read_number, we can make
>> use of of_property_read_u64.
>
> Suggested-by?
>

Yes indeed, added it locally after I sent out this patch. Will send out
a proper patch soon.

>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>
>
>> - cache_size = of_get_property(np, propname, NULL);
>> - if (cache_size)
>> - this_leaf->size = of_read_number(cache_size, 1);
>> + if (!of_property_read_u64(np, propname, &cache_size))
>> + this_leaf->size = cache_size;
>
> I suppose it's something like this
>
> ret = of_property_...(..., &this_leaf->VAR);
> if (ret)
> warning / set default / etc

OK, I do prefer this but once I was told not to use structure elements
directly like that, but should be harmless in this particular case, will
do so.

--
Regards,
Sudeep

\
 
 \ /
  Last update: 2018-05-21 11:27    [W:0.163 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site