summaryrefslogtreecommitdiffstats
path: root/rust/bindings/bindings_helper.h
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2023-05-31 17:44:50 +0000
committerMiguel Ojeda <ojeda@kernel.org>2023-06-13 01:24:42 +0200
commitd2e3115d717197cb2bc020dd1f06b06538474ac3 (patch)
treece25ae73636780e460a5a3a7f714ec1f3b075f16 /rust/bindings/bindings_helper.h
parentd09a61024f6b78c6a08892fc916cdafd87b50365 (diff)
downloadlinux-stable-d2e3115d717197cb2bc020dd1f06b06538474ac3.tar.gz
linux-stable-d2e3115d717197cb2bc020dd1f06b06538474ac3.tar.bz2
linux-stable-d2e3115d717197cb2bc020dd1f06b06538474ac3.zip
rust: error: `impl Debug` for `Error` with `errname()` integration
Integrate the `Error` type with `errname()` by providing a new `name()` method. Then, implement `Debug` for the type using the new method. [ Miguel: under `CONFIG_SYMBOLIC_ERRNAME=n`, `errname()` is a `static inline`, so added a helper to support that case, like we had in the `rust` branch. Also moved `#include` up and reworded commit message for clarity. ] Co-developed-by: Wedson Almeida Filho <walmeida@microsoft.com> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Co-developed-by: Sven Van Asbroeck <thesven73@gmail.com> Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com> Signed-off-by: Gary Guo <gary@garyguo.net> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Link: https://lore.kernel.org/r/20230531174450.3733220-1-aliceryhl@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/bindings/bindings_helper.h')
-rw-r--r--rust/bindings/bindings_helper.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 50e7a76d5455..3e601ce2548d 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -6,6 +6,7 @@
* Sorted alphabetically.
*/
+#include <linux/errname.h>
#include <linux/slab.h>
#include <linux/refcount.h>
#include <linux/wait.h>