# Re: \[PATCH v1 1/1\] treewide: Align match\_string() with sysfs\_match\_string()

- From: Linus Walleij \<hidden\>
- Date: 2024-06-10 08:08:14 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2024/06/2632065
- Thread: https://ratatoskr.run/linuxppc-dev/2024/06/2624286/t.md

```text
On Tue, Jun 4, 2024 at 9:46 AM Jani Nikula [ref] wrote:

[Maybe slightly off-topic, ranty]

> Why do we think it's a good idea to increase and normalize the use of
> double-underscore function names across the kernel, like
> __match_string() in this case? It should mean "reserved for the
> implementation, not to be called directly".
>
> If it's to be used directly, it should be named accordingly, right?

It's a huge mess. "__" prefix is just so ambiguous I think it just
shouldn't be used or prolifierated, and it usually breaks Rusty Russells
API rules times over.

Consider __set_bit() from <linux/bitops.h>, used all over the place,
in contrast with set_bit() for example, what does "__" represent in
this context that makes __set_bit() different from set_bit()?

It means "non-atomic"...

How does a random contributor know this?

Yeah, you guess it. By the token of "everybody knows that".
(Grep, google, repeat for the number of contributors to the kernel.)

I was considering to send a script to Torvalds to just change all
this to set_bit_nonatomic() (etc) but was hesitating because that
makes the name unambiguous but long. I think I stayed off it
because changing stuff like that all over the place creates churn
and churn is bad.

Yours,
Linus Walleij
```
