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]
Date:   Mon, 7 Feb 2022 09:39:10 -0800
From:   Michel Lespinasse <michel@...pinasse.org>
To:     Liam Howlett <liam.howlett@...cle.com>
Cc:     Michel Lespinasse <michel@...pinasse.org>,
        Linux-MM <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "kernel-team@...com" <kernel-team@...com>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        Jerome Glisse <jglisse@...gle.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Michal Hocko <mhocko@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Davidlohr Bueso <dave@...olabs.net>,
        Matthew Wilcox <willy@...radead.org>,
        Rik van Riel <riel@...riel.com>,
        Paul McKenney <paulmck@...nel.org>,
        Song Liu <songliubraving@...com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Minchan Kim <minchan@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        David Rientjes <rientjes@...gle.com>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH v2 03/35] mmap locking API: name the return values

On Mon, Jan 31, 2022 at 04:17:43PM +0000, Liam Howlett wrote:
> * Michel Lespinasse <michel@...pinasse.org> [220128 08:10]:
> > In the mmap locking API, the *_killable() functions return an error
> > (or 0 on success), and the *_trylock() functions return a boolean
> > (true on success).
> > 
> > Rename the return values "int error" and "bool ok", respectively,
> > rather than using "ret" for both cases which I find less readable.
> 
> Would it be better to add function documentation in regards to return
> types?  I think changing the variables does help, but putting a block
> with Return: <what's above> would work best.

That would work, I guess. I'm not sure what it says about our general
coding style, that the comment would kinda stick out like a sore thumb
compared to the rest of the file, or of similar include files
(say, other lock definitions). I don't care very strongly either way.

--
Michel "walken" Lespinasse

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ