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]
Date:   Wed, 3 May 2017 19:11:49 +0200
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
        linux-iio@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Sascha Weisenberger <sascha.weisenberger@...mens.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>
Subject: Re: [PATCH v2] iio: adc: Add support for TI ADC1x8s102

On 2017-05-03 10:43, Andy Shevchenko wrote:
> On Wed, May 3, 2017 at 11:24 AM, Jan Kiszka <jan.kiszka@...mens.com> wrote:
>> On 2017-05-03 10:06, Andy Shevchenko wrote:
>>> On Wed, May 3, 2017 at 8:35 AM, Jan Kiszka <jan.kiszka@...mens.com> wrote:
>>>> On 2017-05-02 22:53, Andy Shevchenko wrote:
> 
>>>>>> +       ret = device_property_read_u32(&spi->dev, "ext-vin-microvolt", &val);
>>>>>
>>>>> Why not to read u16 here?
>>>>>
>>>>
>>>> Can I read a property with arbitrary width? Then this would simplify
>>>> things.
>>>
>>> device_property_read_u16();
>>
>> By now I found out that ACPI does not care about the property type
>> width, only DT does. So reading it as u16 under ACPI would be fine. But
>> with DT, we will need a correctly sized property as well - default is u32.
> 
> I'm a bit lost here. ACPI cares and DT cares about property size.

ACPI_TYPE_INTEGER, used for properties, is always stored and read as
64-bit value and then casted to the requested type.

In contrast, if you restrict a DT property via "/bits/ XX", its storage
format changes, and you are better off using the correct access function
for it. That's what I mean.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ