mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jimmy Ostler <jtostler1@gmail.com>
To: "Danilo Krummrich" <dakr@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Wedson Almeida Filho" <walmeida@microsoft.com>,
	"Filipe Xavier" <felipe_life@live.com>,
	"Valentin Obst" <kernel@valentinobst.de>,
	"Daniel Sedlak" <daniel@sedlak.dev>,
	"Alex Mantel" <alexmantel93@mailbox.org>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jimmy Ostler <jtostler1@gmail.com>
Subject: [PATCH v3 1/3] rust: error: Change `LayoutError` to internal
Date: Tue, 17 Dec 2024 16:23:10 -0800	[thread overview]
Message-ID: <966cc6950c3e8705462f330d2bd002d305ebbc93.1734477232.git.jtostler1@gmail.com> (raw)
In-Reply-To: <cover.1734477232.git.jtostler1@gmail.com>

Add an implementation of `From<LayoutError> for Error` for the
`kernel::alloc::layout::LayoutError`.
Remove the implementation on `core::alloc::LayoutError`, because we
don't use it anywhere.

Signed-off-by: Jimmy Ostler <jtostler1@gmail.com>
---
 rust/kernel/error.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 914e8dec1abd..f6ecf09cb65f 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -4,9 +4,10 @@
 //!
 //! C header: [`include/uapi/asm-generic/errno-base.h`](srctree/include/uapi/asm-generic/errno-base.h)
 
-use crate::{alloc::AllocError, str::CStr};
-
-use core::alloc::LayoutError;
+use crate::{
+    alloc::{layout::LayoutError, AllocError},
+    str::CStr,
+};
 
 use core::fmt;
 use core::num::NonZeroI32;
-- 
2.47.1


  reply	other threads:[~2024-12-18  0:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18  0:23 [PATCH v3 0/3] rust: add kunit doctest with doc fixes Jimmy Ostler
2024-12-18  0:23 ` Jimmy Ostler [this message]
2024-12-18  0:57   ` [PATCH v3 1/3] rust: error: Change `LayoutError` to internal Miguel Ojeda
2024-12-18 12:43     ` Danilo Krummrich
2024-12-20  6:15       ` Jimmy Ostler
2024-12-18  0:23 ` [PATCH v3 2/3] rust: error: Update 'stack_try_pin_init' example Jimmy Ostler
2024-12-18 12:48   ` Danilo Krummrich
2024-12-18  0:23 ` [PATCH v3 3/3] rust: alloc: Add doctest for `ArrayLayout` Jimmy Ostler
2024-12-18 12:48   ` Danilo Krummrich

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=966cc6950c3e8705462f330d2bd002d305ebbc93.1734477232.git.jtostler1@gmail.com \
    --to=jtostler1@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=alexmantel93@mailbox.org \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel@sedlak.dev \
    --cc=felipe_life@live.com \
    --cc=gary@garyguo.net \
    --cc=kernel@valentinobst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=walmeida@microsoft.com \
    /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

all inboxes | Powered by JetHome®