Skip to content

rust/kernel: remove config #ifdef in mutex.rs file - #357

Merged
ojeda merged 1 commit into
Rust-for-Linux:rustfrom
TheSven73:rust-for-linux-no-ifdefs2
Jun 8, 2021
Merged

rust/kernel: remove config #ifdef in mutex.rs file#357
ojeda merged 1 commit into
Rust-for-Linux:rustfrom
TheSven73:rust-for-linux-no-ifdefs2

Conversation

@TheSven73

Copy link
Copy Markdown
Collaborator

The use of #ifdef CONFIG_ statements in .c/.rs files should be
avoided: it makes the code much more unmaintainable over time. See:
https://lore.kernel.org/lkml/YLjWKwhp7akqyR1S@kroah.com/

Use a Rust-C helper instead to leverage automatic CONFIG selection
in C kernel headers.

Signed-off-by: Sven Van Asbroeck thesven73@gmail.com

The use of `#ifdef CONFIG_` statements in .c/.rs files should be
avoided: it makes the code much more unmaintainable over time. See:
https://lore.kernel.org/lkml/YLjWKwhp7akqyR1S@kroah.com/
Use a Rust-C helper instead to leverage automatic `CONFIG` selection
in C kernel headers.
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
@ksquirrel

Copy link
Copy Markdown
Member

Review of a8553d87d15b:

@ojeda

ojeda commented Jun 5, 2021

Copy link
Copy Markdown
Member

LGTM

@ojeda
ojeda merged commit 7764b8c into Rust-for-Linux:rustJun 8, 2021
@TheSven73
TheSven73 deleted the rust-for-linux-no-ifdefs2 branch June 8, 2021 15:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@TheSven73@ksquirrel@ojeda@wedsonaf