Re: [TECH TOPIC] Rust for Linux

Miguel Ojeda
2021-07-19T14:54:13Z

On Mon, Jul 19, 2021 at 4:02 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> - All the dev_dbg() seem to be replaced with pr_debug!(). Does that mean
> we lose the information about the device instance in the output, or is
> that magically added back?

We do not have the `dev_*`-style printing facilities yet, but we will.

> - What's with all the CamelCase? Is that enforced by the language, or
> can we use the same identifiers here that we have in the C version?

It is not a hard error, but we recommend following the standard Rust
style (and we enforce it, currently). As Linus said, it is a way to
easily differentiate what is what, instead of using a prefix or
suffix:
- Types (and similar) are in `CamelCase`.
- Functions (and similar) are in `snake_case`.
- Statics/consts are in `SCREAMING_CASE`.

See https://rust-lang.github.io/api-guidelines/naming.html

Cheers,
Miguel