]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: error: add missing error codes
authorAlice Ryhl <aliceryhl@google.com>
Thu, 4 May 2023 06:48:54 +0000 (06:48 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 31 May 2023 16:53:10 +0000 (18:53 +0200)
commite37b654c379e514357ccadb22c6291d3471fa5e5
treef24d90d8c3bacad9001807aaf0d54a72d038fec8
parent66bd7533ef19bf8a3515ce702013aba368f58df3
rust: error: add missing error codes

This adds the error codes from `include/linux/errno.h` to the list of
Rust error constants. These errors were not included originally, because
they are not supposed to be visible from userspace. However, they are
still a perfectly valid error to use when writing a kernel driver. For
example, you might want to return ERESTARTSYS if you receive a signal
during a call to `schedule`.

This patch inserts an annotation to skip rustfmt on the list of error
codes. Without it, three of the error codes are split over several
lines, which looks terribly inconsistent.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Link: https://lore.kernel.org/r/20230504064854.774820-1-aliceryhl@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/error.rs