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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfEYcPdECmDDOd8CLBBXGpcwSUGQRr0x8VTb1-7j51_0Q@mail.gmail.com>
Date:   Sat, 19 May 2018 00:50:08 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Sudeep Holla <sudeep.holla@....com>
Cc:     Jeremy Linton <jeremy.linton@....com>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
        Hanjun Guo <hanjun.guo@...aro.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Will Deacon <Will.Deacon@....com>,
        Catalin Marinas <Catalin.Marinas@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mark Rutland <Mark.Rutland@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-riscv@...ts.infradead.org,
        Xiongfeng Wang <wangxiongfeng2@...wei.com>,
        vkilari@...eaurora.org, Al Stone <ahs3@...hat.com>,
        Dietmar.Eggemann@....com, Morten.Rasmussen@....com,
        Palmer Dabbelt <palmer@...ive.com>,
        Len Brown <lenb@...nel.org>,
        John Garry <john.garry@...wei.com>, austinwc@...eaurora.org,
        tnowicki@...iumnetworks.com, jhugo@...eaurora.org,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>
Subject: Re: [PATCH v9 02/12] drivers: base: cacheinfo: setup DT cache
 properties early

On Thu, May 17, 2018 at 6:47 PM, Sudeep Holla <sudeep.holla@....com> wrote:

> Is below patch does what you were looking for ?

Somewhat.
See below for some minors.

> 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?

> Signed-off-by: Sudeep Holla <sudeep.holla@....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

>                 propname = cache_type_info[ct_idx].line_size_props[i];
> -               line_size = of_get_property(np, propname, NULL);
> -               if (line_size)
> +               line_size = of_property_read_u64(np, propname, &line_size);
> +               if (line_size) {

ret = ...
if (ret) {

> +                       this_leaf->coherency_line_size = line_size;
>                         break;
> +               }

> +       if (!of_property_read_u64(np, propname, &nr_sets))
> +               this_leaf->number_of_sets = nr_sets;

As in first case.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ