Rust for Linux List
 help / color / mirror / Atom feed
From: Mike Lothian <mike@fireburn.co.uk>
To: rust-for-linux@vger.kernel.org
Cc: "Mike Lothian" <mike@fireburn.co.uk>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Mirko Adzic" <adzicmirko97@gmail.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Daniel del Castillo" <delcastillodelarosadaniel@gmail.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 8/9] rust: error: expose EPROTO
Date: Wed, 26 Aug 2026 17:28:42 +0100	[thread overview]
Message-ID: <20260826162851.2497-9-mike@fireburn.co.uk> (raw)
In-Reply-To: <20260826162851.2497-1-mike@fireburn.co.uk>

Add the named protocol-error constant so Rust protocol drivers
can return the same specific errno as their C counterparts without
constructing it from a raw integer.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
---
 rust/kernel/error.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index a56ba6309594..9492471c2677 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -64,6 +64,7 @@ macro_rules! declare_err {
     declare_err!(EPIPE, "Broken pipe.");
     declare_err!(EDOM, "Math argument out of domain of func.");
     declare_err!(ERANGE, "Math result not representable.");
+    declare_err!(EPROTO, "Protocol error.");
     declare_err!(EOVERFLOW, "Value too large for defined data type.");
     declare_err!(EMSGSIZE, "Message too long.");
     declare_err!(ETIMEDOUT, "Connection timed out.");

  parent reply	other threads:[~2026-08-26 16:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 16:28 [PATCH 0/9] rust: core abstractions for a USB display driver Mike Lothian
2026-08-26 16:28 ` [PATCH 1/9] rust: sync: completion: add single-shot and timed operations Mike Lothian
2026-08-26 16:28 ` [PATCH 2/9] rust: hrtimer: add ArcHrTimerHandle::restart Mike Lothian
2026-08-27 13:27   ` Andreas Hindborg
2026-08-26 16:28 ` [PATCH 3/9] rust: random: add a safe get_random_bytes wrapper Mike Lothian
2026-08-26 16:28 ` [PATCH 4/9] rust: xxhash: add a safe xxh64 wrapper Mike Lothian
2026-08-26 16:28 ` [PATCH 5/9] rust: workqueue: make OwnedQueue thread-safe Mike Lothian
2026-08-26 16:28 ` [PATCH 6/9] rust: io: add checked offset copy helpers Mike Lothian
2026-08-26 16:28 ` [PATCH 7/9] rust: hrtimer: expose interrupt state in hard callbacks Mike Lothian
2026-08-27 13:34   ` Andreas Hindborg
2026-08-26 16:28 ` Mike Lothian [this message]
2026-08-26 16:34   ` [PATCH 8/9] rust: error: expose EPROTO Miguel Ojeda
2026-08-26 16:28 ` [PATCH 9/9] rust: time: add ktime_get_real_seconds Mike Lothian
2026-08-27 13:39   ` Andreas Hindborg
2026-08-26 16:54 ` [PATCH 0/9] rust: core abstractions for a USB display driver Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260826162851.2497-9-mike@fireburn.co.uk \
    --to=mike@fireburn.co.uk \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=adzicmirko97@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=alistair.francis@wdc.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=delcastillodelarosadaniel@gmail.com \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox