From patchwork Thu Nov 10 16:41:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 18202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp251004wru; Thu, 10 Nov 2022 08:42:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM5y2TJFq5WXaXEzO1uWEkhVdKmcSbAIx+vgss23O1BhWRhH3/SuhBRjWn5k1XvT56hbqtAr X-Received: by 2002:a17:902:cad5:b0:176:a6c5:20c9 with SMTP id y21-20020a170902cad500b00176a6c520c9mr1511741pld.57.1668098577607; Thu, 10 Nov 2022 08:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668098577; cv=none; d=google.com; s=arc-20160816; b=rnfX95ernInDZAVbz2GujFr0zhxkVKy+Rm1ti/dGvpFilyv98ydtdACPIOR/OQyABj dOnwZSbOZNP8QgqFdt5qlood+YHDrYgL4YVbN4W6yHxZb/WMXW77L0VZbASolpcrmMne lK6GmBPRAAAM+61q77pOd6kTNQPrY6h4sK63S/yXgv3ZnN7XROuA6UJN8t/IpPKhgaP0 q3Z8cbmRU5QLvIFVaf6oRpANtOACAFt43QA8UpQ0tpeNZJwd/IMEYMmFdg0Uyq4JJuG7 +5O0xSN+m0+JaBHIWu6+lIJkkRooKdQIuRWOT97yY3uIBkkZOVYaGxFuF1sREjHkVD16 aJbQ== 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=Ky3irMIHw9BjxKXhrRB62YwEqHJh7CNWybyxssaMrq0=; b=KTbf6VfOEpmauWs19CtdeFKqmfphhU7qw6GpJ79E09iYLByq65u8H7GoRFAnzF1vrf lKXjuEYmuX4nO/VxpQjLHJhF4si/63TG+bVLc3wNro832IW/X4P5nIjD6I42fJb3PTi4 Q/Dgp+/sKn21yYLIVb41JorSSXhcO8Zjd9dKcrEh6pXPK3XXkC6mpI16c2FjLiNDmj9A Z5uF+CvgmWi93qdAGeUQJYm0No+mLxhEOKMRw1BomKGNc2fsG4qFLteBvAX5Vni2Rm5l nArkb7LQNbU2bUjaoNMliBa+pojbHD49v4PM2tMu/BR9krWsuElNwW1W4FvRGP1rQ9i+ YZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=du9DSV2f; 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 m12-20020a170902bb8c00b00174ea015ee8si18407663pls.592.2022.11.10.08.42.39; Thu, 10 Nov 2022 08:42:57 -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=du9DSV2f; 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 S232000AbiKJQm1 (ORCPT + 99 others); Thu, 10 Nov 2022 11:42:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbiKJQm0 (ORCPT ); Thu, 10 Nov 2022 11:42:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7550C4198A; Thu, 10 Nov 2022 08:42:21 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 13A6861BCD; Thu, 10 Nov 2022 16:42:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9240CC433D7; Thu, 10 Nov 2022 16:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668098540; bh=TpYB3dU1gfW4+Y/Ug35QXprZPPfBIkjSDAYCOHoY5AU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=du9DSV2ffNd/eTmXOXKDHseXWj0fdF5SabVHYv4yY9lYA8lKRuij1VOdGWFShHAtc bTqhBNIk0vwv6JuixnIUus4RHxpN17Um5v670GoXdzJUMBbt4AEdAeyp1ce1rL/Ym0 ocKKNzwuvsDkQF7Jf9ItZpObvEkQieohQpc6p5OTDauzvNQAfDtvXQY4lCNRTlutou Udgxan5RLaUO9JzkdMw5qsGb71ODMcQ1iazpFdW+c3vGIE5l7xFvYbPWVMEZm1FRlh yWBHn/c1S2XbCnuiib9TIxBZT5oG9diR0dH2BPSkQWKwCIdyL61bwYaWasi8EfMcRO 7Z8o0uDMfNoVQ== From: Miguel Ojeda To: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH v1 01/28] rust: prelude: split re-exports into groups Date: Thu, 10 Nov 2022 17:41:13 +0100 Message-Id: <20221110164152.26136-2-ojeda@kernel.org> In-Reply-To: <20221110164152.26136-1-ojeda@kernel.org> References: <20221110164152.26136-1-ojeda@kernel.org> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749128134079924683?= X-GMAIL-MSGID: =?utf-8?q?1749128134079924683?= 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). Signed-off-by: Miguel Ojeda Reviewed-by: Boqun Feng Reviewed-by: Wei Liu --- 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;