lkml.org 
[lkml]   [2022]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@lespinasse.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

\
 
 \ /
  Last update: 2022-02-07 18:52    [W:0.088 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site