Message ID | 20230329223239.138757-11-y86-dev@protonmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp733572vqo; Wed, 29 Mar 2023 15:46:21 -0700 (PDT) X-Google-Smtp-Source: AKy350YLCCRUTL67Joi7GtzHFRcgOFoW/nA8WxcryAgDSzKMbfUEZMKRh4o1riWdn4kmYFjkEU3k X-Received: by 2002:aa7:c1ce:0:b0:502:1f0d:140b with SMTP id d14-20020aa7c1ce000000b005021f0d140bmr20729180edp.11.1680129981405; Wed, 29 Mar 2023 15:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680129981; cv=none; d=google.com; s=arc-20160816; b=IY4/MIpXdrpXc1r84GBQHjwmMvsEFstuCVk0dtQomey6pxLwlpiqFwsBQ58nprzX+X 2AoWgWT9Q96GKGmo6392a2xOwlYG1q4Qf0FmNHpgAMld4O1fz6ck2xVO0lucDsFeK5tb 0SYy1rL4mXRfQaKTQwIdr4oLKNnbCy4JkIs1tAnWw6GZz5shLekqoEtwzIF+YLkcEnDr L156eEO0TITBPpQcOLRYN716Pb9FxPRm7yWMEli5q7ougkPYX3H9cbGNJExUZGZju6M9 PplBq95l0mH+2uktf6DToogHi2W6BCyNk/Fv31bJiN5ejkegXi758HcfiUSn8jhi0t9U yRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:message-id:subject:cc:from:to:dkim-signature:date; bh=WBq9Qox9RYulnSw9oc/MGso5/S0eX4nkpu/+y4M+6as=; b=zx0NdWyB7Ll7wHj4X3fAgwibseB1zwuiAf0ICAUJvGWZ0pPVBPy8863Glj3LNtvycR FmkX2HlGbZkq03Vp6cGDtZEg+IYAvVg0c6dkHd9agmVHzkaQtuXdML2OyjgCvmo6rVSH QodAB0y9FG6hqpk+m+PWvkzW8rIvAMzrwihZ/M5rhFCc7/KfpuOVYUMb+xa6wisjzFXj BnxBFVpzdnzLshK52Om2SQ4k0VjcGLFT8v4ZEEcTiujuw0pfL8Bbba5DZbxlN0QT/w4U TA9IqjsxbinftBH4tj47GoGYnunS7nU+130l3DmBRw6H1s7owrKRRB+0J7n41k9zlhlp svbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=J0V9SVh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a056402516f00b004fb438282dfsi33219230ede.526.2023.03.29.15.45.56; Wed, 29 Mar 2023 15:46:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=J0V9SVh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbjC2WfC (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Wed, 29 Mar 2023 18:35:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbjC2Wee (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Mar 2023 18:34:34 -0400 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929CA4C28; Wed, 29 Mar 2023 15:34:06 -0700 (PDT) Date: Wed, 29 Mar 2023 22:33:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680129240; x=1680388440; bh=WBq9Qox9RYulnSw9oc/MGso5/S0eX4nkpu/+y4M+6as=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=J0V9SVh1KtaWFwjveTDKp+0NCuN4siA12pgB9f0jXBxXKUd2CYMTN8WxeLyy3AXw2 Rxu4x25pGOSzXCwcnvHL3voDdw8cPcqnMf14tGv7kmNOJYwuTeksOIIhy8uKqWY1Lr 2IlmLEccE5DPrNzujrRTD/+963tKd/+2XLo4RhYz9Nm3nwDWqTgOTiLbeMk2hkOmx8 bjf3LlAU5vp+1z5ltRi84yZdIVwOSiQqS/t35tJdaU58lNfqYM6WbCEtK1JiKMXkeg LCK7ol3OjeMcCY3G5enM7jha0pX0v/QiZ1966SH5Ci6TzkQnOnxqkII7wqSFWtWMTH ANnJrvM1T8UzQ== To: Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>, Wedson Almeida Filho <wedsonaf@gmail.com>, Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>, =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, Alice Ryhl <alice@ryhl.io> From: y86-dev@protonmail.com Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH v3 10/13] rust: prelude: add `pin-init` API items to prelude Message-ID: <20230329223239.138757-11-y86-dev@protonmail.com> Feedback-ID: 40624463:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761743975277134835?= X-GMAIL-MSGID: =?utf-8?q?1761743975277134835?= |
Series |
Rust pin-init API for pinned initialization of structs
|
|
Commit Message
y86-dev
March 29, 2023, 10:33 p.m. UTC
From: Benno Lossin <y86-dev@protonmail.com> Add `pin-init` API macros and traits to the prelude. Signed-off-by: Benno Lossin <y86-dev@protonmail.com> --- rust/kernel/prelude.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.39.2
Comments
On Wed, 29 Mar 2023 22:33:40 +0000 y86-dev@protonmail.com wrote: > From: Benno Lossin <y86-dev@protonmail.com> > > Add `pin-init` API macros and traits to the prelude. > > Signed-off-by: Benno Lossin <y86-dev@protonmail.com> Reviewed-by: Gary Guo <gary@garyguo.net> > --- > rust/kernel/prelude.rs | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs > index 0bc1c97e5604..fcdc511d2ce8 100644 > --- a/rust/kernel/prelude.rs > +++ b/rust/kernel/prelude.rs > @@ -18,7 +18,7 @@ pub use core::pin::Pin; > pub use alloc::{boxed::Box, vec::Vec}; > > #[doc(no_inline)] > -pub use macros::{module, vtable}; > +pub use macros::{module, pin_data, pinned_drop, vtable}; > > pub use super::build_assert; > > @@ -27,8 +27,12 @@ pub use super::build_assert; > pub use super::dbg; > pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn}; > > +pub use super::{init, pin_init, try_init, try_pin_init}; > + > pub use super::static_assert; > > pub use super::error::{code::*, Error, Result}; > > pub use super::{str::CStr, ThisModule}; > + > +pub use super::init::{InPlaceInit, Init, PinInit}; > -- > 2.39.2 > >
On 3/30/23 00:33, y86-dev@protonmail.com wrote: > From: Benno Lossin <y86-dev@protonmail.com> > > Add `pin-init` API macros and traits to the prelude. > > Signed-off-by: Benno Lossin <y86-dev@protonmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
y86-dev@protonmail.com writes: > From: Benno Lossin <y86-dev@protonmail.com> > > Add `pin-init` API macros and traits to the prelude. > > Signed-off-by: Benno Lossin <y86-dev@protonmail.com> > --- Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com> > rust/kernel/prelude.rs | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs > index 0bc1c97e5604..fcdc511d2ce8 100644 > --- a/rust/kernel/prelude.rs > +++ b/rust/kernel/prelude.rs > @@ -18,7 +18,7 @@ pub use core::pin::Pin; > pub use alloc::{boxed::Box, vec::Vec}; > > #[doc(no_inline)] > -pub use macros::{module, vtable}; > +pub use macros::{module, pin_data, pinned_drop, vtable}; > > pub use super::build_assert; > > @@ -27,8 +27,12 @@ pub use super::build_assert; > pub use super::dbg; > pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn}; > > +pub use super::{init, pin_init, try_init, try_pin_init}; > + > pub use super::static_assert; > > pub use super::error::{code::*, Error, Result}; > > pub use super::{str::CStr, ThisModule}; > + > +pub use super::init::{InPlaceInit, Init, PinInit};
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index 0bc1c97e5604..fcdc511d2ce8 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -18,7 +18,7 @@ pub use core::pin::Pin; pub use alloc::{boxed::Box, vec::Vec}; #[doc(no_inline)] -pub use macros::{module, vtable}; +pub use macros::{module, pin_data, pinned_drop, vtable}; pub use super::build_assert; @@ -27,8 +27,12 @@ pub use super::build_assert; pub use super::dbg; pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn}; +pub use super::{init, pin_init, try_init, try_pin_init}; + pub use super::static_assert; pub use super::error::{code::*, Error, Result}; pub use super::{str::CStr, ThisModule}; + +pub use super::init::{InPlaceInit, Init, PinInit};