From patchwork Wed Apr 5 19:36:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: y86-dev X-Patchwork-Id: 79879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp546804vqo; Wed, 5 Apr 2023 12:39:18 -0700 (PDT) X-Google-Smtp-Source: AKy350avYKg5y2hVC3d/HmzyLNKdOyZaaBY5qUkDhQUdyHUJAvrybcF5Dgk/O8OlUs8AF2Ad8jx4 X-Received: by 2002:a17:903:706:b0:19e:65db:7ac3 with SMTP id kk6-20020a170903070600b0019e65db7ac3mr6183605plb.68.1680723558038; Wed, 05 Apr 2023 12:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680723558; cv=none; d=google.com; s=arc-20160816; b=QrFG1kTMEOEnFr5LCAxROJK8aPZWv+2V+nkzPqO++flxis27s7gv08TLpGrzRhsMFQ wcYpKl5YQscSY+MRanZDxr+U55WI6xXQ4+b7CBVlPWdqhIAYUXKh5eI4AGCaL+f0xeBp Ugjq6nsEMvolYE7Z87SLJYk71jN8OiYr4jeyejDdZSf2SaGTs0XKw5sAg8YBRWPwTgJ1 O6W+BXEyhH/29xrOaRTqspGoxxC/4YHr0qgzsEF2SKS+dCBY40KdtG9+l0TjTM0Rx6Oc vsxRRaFFJZ7i46js2ItmGR+LgsgH99go0zLUuUxsV82aeMDdY8EJmw5QLTFZ6Ug5Fjeh 3u8w== 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:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=gdEIW+2bBi1IvDlMbXGasea4+ibnJ2p7QwfZLUN+zQA=; b=YSPyLE/eVM6Yg4ebI392f/iog12tPlBBpGwcClsCC5r3Oc2OKlG4jriypokwXu3Kh9 9817IaIfJPg++GNesm8lak60b5HB0ntmPA11o2MiJx6y4ncd9THNJY9sA4BpbJ7bn7Lc fSw/FlyXP7pv8obeR/isDUooZAoRqeBTm2bKC9ePToOZ5mjJ9GQvivQt35CdnVimIcUy kUFgiNvMee05BCEFXmqNwgK+9KRRF5UeB9dhhCiBMQBcdh5jivyKC49i1rQVtVM+FQzC YsFB7uB6lj0m09272qb0NwT7SWxyM8RnyGASdBYrtz0/N079qDsVlgAU37bG6ekIa0qQ B5zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=vseFoYZ2; 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 j14-20020a170903024e00b0019ac13b77efsi3818110plh.158.2023.04.05.12.39.05; Wed, 05 Apr 2023 12:39:18 -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=vseFoYZ2; 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 S233742AbjDETiB (ORCPT + 99 others); Wed, 5 Apr 2023 15:38:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234120AbjDEThj (ORCPT ); Wed, 5 Apr 2023 15:37:39 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB3B17D80 for ; Wed, 5 Apr 2023 12:37:18 -0700 (PDT) Date: Wed, 05 Apr 2023 19:36:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680723416; x=1680982616; bh=gdEIW+2bBi1IvDlMbXGasea4+ibnJ2p7QwfZLUN+zQA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=vseFoYZ2AedjxwlXJ3fIjHnHGUIujb/axlbQHpdZbxcvkaslLN1WTFsA7YM3LB858 pvGizao1DJjhKyBl5p537z73NOCdj8QKKV0wxa8vDj1p/P/N1pwYEIsvwH95IH7M/i 7atH4Ra2gTX00vff6+oQkXRiBbmAYenT3MLkzkdvZfo83e5cbHej45umedVd5CMw6T 5vJGlDEJGGHciHru9A9lR0u5EV/UFjCLbaQywYwQhX6KaWBvFsUG/jIsucCcbFqjq6 qxMaxldA43c/Qj2lugQvRJGBBbu1/HQPdMJy/sTz4tnKDF8AD1em+wG2NUQ8pepM39 GsZn59T03sAjg== To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Andreas Hindborg From: Benno Lossin Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Benno Lossin , Alice Ryhl , Andreas Hindborg Subject: [PATCH v6 12/15] rust: prelude: add `pin-init` API items to prelude Message-ID: <20230405193445.745024-13-y86-dev@protonmail.com> In-Reply-To: <20230405193445.745024-1-y86-dev@protonmail.com> References: <20230405193445.745024-1-y86-dev@protonmail.com> Feedback-ID: 40624463:user:proton MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762366385815738971?= X-GMAIL-MSGID: =?utf-8?q?1762366385815738971?= Add `pin-init` API macros and traits to the prelude. Signed-off-by: Benno Lossin Reviewed-by: Gary Guo Reviewed-by: Alice Ryhl Reviewed-by: Andreas Hindborg --- rust/kernel/prelude.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.39.2 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};