Message ID | 20221202161502.385525-2-ojeda@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp947336wrr; Fri, 2 Dec 2022 08:17:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5imJ08DPrGiJuR2i8RzcoF96h28CiV9baAo31GlbfQ2LYLPqBTheaUz045A7FSx5+G1odY X-Received: by 2002:a17:902:f609:b0:188:a8a2:f43a with SMTP id n9-20020a170902f60900b00188a8a2f43amr63476999plg.130.1669997862720; Fri, 02 Dec 2022 08:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669997862; cv=none; d=google.com; s=arc-20160816; b=PxnYGRep+F9AFfVkTcz12x2ALih73xQ4SXo0FKb5WmLoNE0ry8BuHc8VCqdavPm/p8 4pMebwDIwGSnTQB8ICnvYtMD9jUTODGwtUO8qpDU5UIOevtR5ldpRrgJn+Oyd2doBIRQ qi2vIFx7MpPY8a42IdlNLcLwrpc/WFJU0Ze5WEu/yqdc9jby37f8/qNfNeTwdnKeh33B jFEMUC2J3b+Cm6lMXZpWpL4yTC/4/S/zRKGXV/ouvsyjpOoGz+TO2Q5Qmz6lCjXvMpye gADk9l+C1vCstLJ9XygMKCdV+QrIRR+sbIp3/6iAVJfdFQE+iBHAHiDr4DR3MMbtr9g3 ytLQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Ohf8zV24wuuXaQRlwMY2G3Iy3P8pF+T/K2OT4EaT/Q=; b=HJVaKY+gpXDsNY9VpbiWsawLAO22xDRCvsX6D3iEvrmuLU0YL1z2km4dYph759aHm+ sbZ1kMxrDl4amZhBHfyB/evV60BSbT2u9oH5g/UH31lMFtJqL0WCamrsAwm35/Y/ObOh rxTd+PVUHJ3OOu+S2RDJ5som8wFCBV+6/zZ4QY2LnkeA4QN5JdNk4Yuu/m5fBLSDlC+o F/j7/FfDRMlnukaHbt1YFd9IMEM4/PkhjswyXirQr8Pp1GOKWph8kDNdUjXjGKRxx+Rb 1yQ603SnYiaN/4AU6MfJCXJxmfh1Oss4/TEeGGzXHZIgDpeoawYTo0QnJsz2rkDKN6+H l+MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=beKukvFA; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw14-20020a17090b180e00b002135a4d80d7si8475405pjb.188.2022.12.02.08.17.28; Fri, 02 Dec 2022 08:17:42 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=beKukvFA; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233760AbiLBQPi (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 11:15:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbiLBQPe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 11:15:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CE69AD30A; Fri, 2 Dec 2022 08:15:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EAAA2B821E8; Fri, 2 Dec 2022 16:15:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80E1EC43470; Fri, 2 Dec 2022 16:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669997730; bh=VSt+/hGabeANQLeUUkDMOId6k6ru4ZPGzmVrw2MIUuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=beKukvFATiP3u3Xmr1v5gXIFi9wWHxS2ykMD9tlunHXc0BjJhHm/7q+kk4wJE0ZDd hZqg8ob2kXYdCh+NZA7oIOv6mMoIPjK2nTBZEo22zPv58BgXDSvVRTZeNSzmto5K6u 3FaBYP0EzT4WRCn/By0vFwDnxZpt+mODz4ADYxZGtf9aYrTSam0ZBk1iuRxxTYiswM l788yFfb5w8NzJqPmgWhfR0a6KD4pvHRZ60BjMVHyxPs9E6GbMYv9hGBsOxzmiaLY0 FKpbd2GlRVljMf5qO/NaoUzsNPUQBB8fjz1/nJFavwPt8woD+NzJ+gQdGzI1oQ6YRw gZenyb9qJdpgA== From: ojeda@kernel.org To: Miguel Ojeda <ojeda@kernel.org>, Wedson Almeida Filho <wedsonaf@gmail.com>, Alex Gaynor <alex.gaynor@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> Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Wei Liu <wei.liu@kernel.org> Subject: [PATCH v2 01/28] rust: prelude: split re-exports into groups Date: Fri, 2 Dec 2022 17:14:32 +0100 Message-Id: <20221202161502.385525-2-ojeda@kernel.org> In-Reply-To: <20221202161502.385525-1-ojeda@kernel.org> References: <20221202161502.385525-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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?1751119678748939837?= X-GMAIL-MSGID: =?utf-8?q?1751119678748939837?= |
Series |
[v2,01/28] rust: prelude: split re-exports into groups
|
|
Commit Message
Miguel Ojeda
Dec. 2, 2022, 4:14 p.m. UTC
From: Miguel Ojeda <ojeda@kernel.org> Split the prelude re-exports into groups: first the ones coming from the `core` crate, then `alloc`, then our own crates and finally the ones from modules from `kernel` itself (i.e. `super`). We are doing this manually for the moment, but ideally, long-term, this could be automated via `rustfmt` with options such as `group_imports` and `imports_granularity` (both currently unstable). Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Wei Liu <wei.liu@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org> --- rust/kernel/prelude.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index 495e22250726..f8219285d8c0 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -11,10 +11,14 @@ //! use kernel::prelude::*; //! ``` -pub use super::{ - error::{Error, Result}, - pr_emerg, pr_info, ThisModule, -}; -pub use alloc::{boxed::Box, vec::Vec}; pub use core::pin::Pin; + +pub use alloc::{boxed::Box, vec::Vec}; + pub use macros::module; + +pub use super::{pr_emerg, pr_info}; + +pub use super::error::{Error, Result}; + +pub use super::ThisModule;