lkml.org 
[lkml]   [2018]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] gpio: mockup: add locking
On Mon, Nov 19, 2018 at 10:09 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> pt., 16 lis 2018 o 22:43 Linus Walleij <linus.walleij@linaro.org> napisał(a):

> > __gpio_*
> > I tend to dislike __underscore_notation because I feel it
> > is semantically ambguous. I prefer a proper name, even
> > to the point that I prefer inner_function_foo over __foo,
> > but it's your driver and I might be a bit grumpy. :)
>
> I think this is a common and intuitive pattern in the kernel codebase.
> Many subsystems and drivers use '__' to mark functions that execute
> internal logic and expect certain locks to be held etc.

You say it yourself: interpretation depends on context.

I might be especially stupid for being unable to discern
meaning from context in these cases and so what is
intuitive for some is just not intuitive for me.

Example:
set_bit() vs __set_bit()

Apparently some kernel developers think it is completely
obvious that the latter is the unlocked non-atomic version
of set_bit(). However I was confused for years with no
idea as to what the difference was.

Had it simply been named set_bit_nonatomic(), at the
cost of a few characters, confusion on my part would be
avoided and at least to me the world would be a better
place.

> If you don't mind, I'd like to leave it like this.

No big deal, keep it as is :)

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2018-11-20 09:47    [W:0.165 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site