public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] rust: error: add ERESTARTSYS error code
@ 2023-05-03  8:39 Alice Ryhl
  2023-05-03  9:50 ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: Alice Ryhl @ 2023-05-03  8:39 UTC (permalink / raw)
  To: Miguel Ojeda, Wedson Almeida Filho, Alex Gaynor
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Alice Ryhl, rust-for-linux, linux-kernel, patches

This error code was probably excluded here originally because it never
actually reaches user programs when a syscall returns it. However, from
the perspective of a kernel driver, it is still a perfectly valid error
type, that the driver might need to return. E.g., this can be necessary
when a signal occurs during sleep.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
 rust/kernel/error.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 5f4114b30b94..cbde1b2d29f4 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -58,6 +58,7 @@ pub mod code {
     declare_err!(EPIPE, "Broken pipe.");
     declare_err!(EDOM, "Math argument out of domain of func.");
     declare_err!(ERANGE, "Math result not representable.");
+    declare_err!(ERESTARTSYS, "Restart the system call.");
 }
 
 /// Generic integer kernel error.

base-commit: ea76e08f4d901a450619831a255e9e0a4c0ed162
-- 
2.40.1.495.gc816e09b53d-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] rust: error: add ERESTARTSYS error code
  2023-05-03  8:39 [PATCH v1] rust: error: add ERESTARTSYS error code Alice Ryhl
@ 2023-05-03  9:50 ` Miguel Ojeda
  0 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2023-05-03  9:50 UTC (permalink / raw)
  To: Alice Ryhl
  Cc: Miguel Ojeda, Wedson Almeida Filho, Alex Gaynor, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, rust-for-linux,
	linux-kernel, patches

On Wed, May 3, 2023 at 10:40 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This error code was probably excluded here originally because it never
> actually reaches user programs when a syscall returns it. However, from

The reason is that commit 266def2a0f5b ("rust: error: add codes from
`errno-base.h`") only introduced the ones from
`include/uapi/asm-generic/errno-base.h`, but not the ones from
`include/linux/errno.h` (or `include/uapi/asm-generic/errno.h`).

Given this is an independent patch, should we introduce the rest too, at once?

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] rust: error: add ERESTARTSYS error code
  2023-04-26 22:57 [PATCH] rust: bindings: fix sorting of rust/bindings/bindings_helper.h's #includes materoy
@ 2023-05-03 10:59 ` Alice Ryhl
  2023-05-03 11:02   ` Alice Ryhl
  0 siblings, 1 reply; 4+ messages in thread
From: Alice Ryhl @ 2023-05-03 10:59 UTC (permalink / raw)
  To: materoy
  Cc: alex.gaynor, aliceryhl, benno.lossin, bjorn3_gh, boqun.feng, gary,
	linux-kernel, ojeda, rust-for-linux, wedsonaf, yakoyoku

On 27.04.23 00:57, Roy Matero <materoy@proton.me> wrote:
> Fix sorting of rust/bindings/binding_helper.h's includes,
> to maintain consistency and rust idoms
> 
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1002
> 
> Signed-off-by: Roy Matero <materoy@proton.me>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] rust: error: add ERESTARTSYS error code
  2023-05-03 10:59 ` [PATCH v1] rust: error: add ERESTARTSYS error code Alice Ryhl
@ 2023-05-03 11:02   ` Alice Ryhl
  0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2023-05-03 11:02 UTC (permalink / raw)
  To: materoy
  Cc: alex.gaynor, benno.lossin, bjorn3_gh, boqun.feng, gary,
	linux-kernel, ojeda, rust-for-linux, wedsonaf, yakoyoku

Seems like I messed up something with this email. It's supposed to be a reply to
https://lore.kernel.org/all/20230426224748.34056-1-materoy@proton.me/

On Wed, May 3, 2023 at 12:59 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> On 27.04.23 00:57, Roy Matero <materoy@proton.me> wrote:
> > Fix sorting of rust/bindings/binding_helper.h's includes,
> > to maintain consistency and rust idoms
> >
> > Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> > Link: https://github.com/Rust-for-Linux/linux/issues/1002
> >
> > Signed-off-by: Roy Matero <materoy@proton.me>
>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-03 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03  8:39 [PATCH v1] rust: error: add ERESTARTSYS error code Alice Ryhl
2023-05-03  9:50 ` Miguel Ojeda
  -- strict thread matches above, loose matches on Subject: below --
2023-04-26 22:57 [PATCH] rust: bindings: fix sorting of rust/bindings/bindings_helper.h's #includes materoy
2023-05-03 10:59 ` [PATCH v1] rust: error: add ERESTARTSYS error code Alice Ryhl
2023-05-03 11:02   ` Alice Ryhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox