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: <CAK8P3a3kSn-YEQXTmer+=NMCJ+5HtE-p0C=TBj1GfSU8=BozKg@mail.gmail.com>
Date:   Thu, 11 May 2017 17:00:07 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Frank Rowand <frowand.list@...il.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] of: reserved_mem: fix 'const' annotation

On Thu, May 11, 2017 at 4:50 PM, Rob Herring <robh+dt@...nel.org> wrote:
> On Thu, May 11, 2017 at 7:24 AM, Arnd Bergmann <arnd@...db.de> wrote:
>> It's the pointer that is supposed to be const, not the return
>> type of the function.
>>
>> drivers/of/of_reserved_mem.c: In function '__reserved_mem_init_node':
>> drivers/of/of_reserved_mem.c:200:7: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
>>    int const (*initfn)(struct reserved_mem *rmem) = i->data;
>>
>> Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
>> Signed-off-by: Arnd Bergmann <arnd@...db.de>
>> ---
>>  drivers/of/of_reserved_mem.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
>> index 4dec07ea510f..3f03ec004829 100644
>> --- a/drivers/of/of_reserved_mem.c
>> +++ b/drivers/of/of_reserved_mem.c
>> @@ -197,7 +197,7 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem)
>>         const struct of_device_id *i;
>>
>>         for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) {
>> -               int const (*initfn)(struct reserved_mem *rmem) = i->data;
>> +               int (* const initfn)(struct reserved_mem *rmem) = i->data;
>
> Why did you move the const here? That doesn't seem to help with sparse.

I must have misread the sparse warning.

> I think I'll just revert this back to using reservedmem_of_init_fn.

Sounds good, thanks.

    Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ