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: <CAHp75VfCvNt2TdGRZ77Gk-j7KQzQTAyuKmvsna9GU5yNesGMkw@mail.gmail.com>
Date:   Wed, 26 Jul 2017 13:26:30 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lee Jones <lee.jones@...aro.org>
Cc:     "Mani, Rajmohan" <rajmohan.mani@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Alexandre Courbot <gnurou@...il.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        "sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>
Subject: Re: [PATCH v4 1/3] mfd: Add new mfd device TPS68470

On Wed, Jul 26, 2017 at 11:23 AM, Lee Jones <lee.jones@...aro.org> wrote:
> On Tue, 25 Jul 2017, Andy Shevchenko wrote:
>> On Tue, Jul 25, 2017 at 12:10 PM, Lee Jones <lee.jones@...aro.org> wrote:

>> I briefly checked few ->read() and ->write() implementations and
>> didn't find any evidence of positive numbers that can be returned.
>> Documentation (kernel doc) doesn't shed a light on that. So, to me it
>> sounds unspecified.
>>
>> So, for now (until documentation will be fixed) I would rely on
>> if (ret < 0)
>
> It's not unspecified.  The regmap methods call into regcache_write(),
> where the kerneldoc is clear.

drivers/base/regmap/regcache.c:266

" * Return a negative value on failure, 0 on success."

I can hardly find this any cleaner than "unspecified".

>  Perhaps we can also change the regmap
> kerneldoc headers too to match, which might lessen the disparity.

I'm not familiar with the guts of regmap API, so, I would stick with
if (ret < 0) for now until documentation specifies positive return values.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ