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]
Message-ID: <CAD=FV=WOZn2vqeZp=EbWjR80Q=6HbdRZbqXr-jK6rBn_dpsyqw@mail.gmail.com>
Date:   Tue, 17 Apr 2018 20:35:18 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Javier Martinez Canillas <javier@...hile0.org>
Cc:     Mark Brown <broonie@...nel.org>,
        David Collins <collinsd@...eaurora.org>,
        Evan Green <evgreen@...omium.org>, swboyd@...omium.org,
        Linux Kernel <linux-kernel@...r.kernel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Tony Lindgren <tony@...mide.com>,
        linux-omap <linux-omap@...r.kernel.org>
Subject: Re: [PATCH] regulator: Fix return type of of_map_mode()

Hi,

On Tue, Apr 17, 2018 at 10:48 AM, Javier Martinez Canillas
<javier@...hile0.org> wrote:
>>> Let's fix the return type of all of the current of_map_mode()
>>> functions.  While we're at it, we'll remove one pointless "inline".
>>
>> Ah, I see...  the thing here is that the mode is always an unsigned int
>> since it's a bitmask - this goes out beying the use in of_map_mode() and
>> into all the other APIs.  We only actually use 4 bits currently so I
>> think there's no problem switching to int but it seems we should
>> probably do that consistently throughout the API so that things don't
>> get missed later on.
>
> Maybe another option could be to add a REGULATOR_MODE_INVALID with
> value 0x0, and fix the drivers that are returning -EINVAL to return
> that instead?
>
> In of_get_regulation_constraints() we could check for that and
> propagate -EINVAL.

I like this idea.  Posted at
<https://patchwork.kernel.org/patch/10347345/>.  Note that there's no
actual error to propagate since of_get_regulation_constraints() just
prints the error and continues on its merry way.

-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ