Skip to content

rust: introduce declare_err! autogeneration

Yiyang Wu linux-erofs linux-fsdevel lkml rust-for-linux 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/21 patch 0 repliesNew
  2. v1 posting 1/21 patch 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1rust: error: auto-generate error declarationsrust/.gitignore rust/Makefile rust/kernel/error.rs+18 -550 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RESEND 0/1] rust: introduce declare_err! autogeneration

Currently, the error.rs's errno import is done manually by copying the comments from include/linux/errno.h and uses the declare_err! to wrap the constant errno.

However, this reduces the readability and increases difficulty of maintaining the error.rs if the errno list is growing too long or or if errno.h gets updated for new semantics.

This patchset solves this issues for good by introducing a rule to generate errno_generated.rs by seding the errno.h and including the generated file in the error.rs.

This patch is based on the rust-next branch.

Yiyang Wu (1):
rust: error: auto-generate error declarations

 rust/.gitignore      |  1 +
 rust/Makefile        | 14 ++++++++++-
 rust/kernel/error.rs | 58 +++-----------------------------------------
 3 files changed, 18 insertions(+), 55 deletions(-)
Signature · 1 line
2.46.0