From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4962392C2E; Thu, 21 May 2026 06:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779346633; cv=none; b=iD1EL43NDets8guZIEyh+x18vFhz+KmX7imiAtjO8dHMM7xN999xoQzdD4l/c27YO2ahrY0qFx5hJtV9zwsEuWDWPxjgXoKwx1hJctZcEdpqJeWZSxfZV9Tp6KaQzS9bjjuuURRu7iO+/aFv4jvIkIUP5XePFSWTytpRTuk3urk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779346633; c=relaxed/simple; bh=ZAphU0EjCdGw+0Fm9VnI2fX2eOGjP3AWC7Pmb+1TUMI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K30GaQ4hjqPysGozISJu1Q3MU3GQ2hY+3/0+yg20le5JnyXH+8+KaVVoQajukn/J2+xyeoXGeoz7QwnLpXtcrRwGNDoSoAR3bgxa2fPBHB7ADreFehamu95gdDV/xyzuRqldmvVkzr++hc6qEfIsLSfgkZedyFECpCSQYoJ0HMA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=NXqYLSXd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="NXqYLSXd" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7C054C4AF0E; Thu, 21 May 2026 06:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1779346633; bh=ZAphU0EjCdGw+0Fm9VnI2fX2eOGjP3AWC7Pmb+1TUMI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NXqYLSXd8LSUpY8UhE3Gs5s+yi3uJyiX6jBf3FggrUCTmyJXcK2BTKHGEGqNMvX1l WXRd0XbY5kBeJ5vewpXc1YX/1SmGCYksipxrLMJanfjVSmSW8SjEJQqnDB/1/ZXR7L lmlaQ70GXaHiuyr25NXdyjN/jEL1i3x0u0dd+73Y= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71D94CD5BAE; Thu, 21 May 2026 06:57:13 +0000 (UTC) From: Alvin Sun Date: Thu, 21 May 2026 14:57:10 +0800 Subject: [PATCH v3 4/7] rust: block: mq: use vertical import style Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260521-miscdev-use-format-v3-4-56240ca70d0c@linux.dev> References: <20260521-miscdev-use-format-v3-0-56240ca70d0c@linux.dev> In-Reply-To: <20260521-miscdev-use-format-v3-0-56240ca70d0c@linux.dev> To: Arnd Bergmann , Greg Kroah-Hartman , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Jens Axboe , Brendan Higgins , David Gow , Rae Moar Cc: rust-for-linux@vger.kernel.org, linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Alvin Sun , =?utf-8?q?Onur_=C3=96zkan?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779346631; l=3793; i=alvin.sun@linux.dev; s=20260317; h=from:subject:message-id; bh=ZAphU0EjCdGw+0Fm9VnI2fX2eOGjP3AWC7Pmb+1TUMI=; b=XSeo0tBnhXizXV7Nk+WflXtQgvWea8sorO+0ReAfL0gGMun5IB2Md7vSYxQfsT/0rlxp4YKyX pgMXn9NQKZ+BBHu3okQ8VkCi6FfSsbAYw4P/3SYdReboHUVS+zcAWIN X-Developer-Key: i=alvin.sun@linux.dev; a=ed25519; pk=CHcwQp8GSoj25V/L1ZWNSQjWp9eSIb0s9LKr0Nm3WuE= X-Endpoint-Received: by B4 Relay for alvin.sun@linux.dev/20260317 with auth_id=684 Convert `use` imports to vertical layout for better readability and maintainability. Reviewed-by: Onur Özkan Signed-off-by: Alvin Sun --- rust/kernel/block/mq/gen_disk.rs | 21 +++++++++++++++++---- rust/kernel/block/mq/operations.rs | 17 +++++++++++++---- rust/kernel/block/mq/request.rs | 14 ++++++++++---- rust/kernel/block/mq/tag_set.rs | 24 +++++++++++++++++++----- 4 files changed, 59 insertions(+), 17 deletions(-) diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs index 912cb805caf51..aac8ece10ae7c 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -7,14 +7,27 @@ use crate::{ bindings, - block::mq::{Operations, TagSet}, - error::{self, from_err_ptr, Result}, - fmt::{self, Write}, + block::mq::{ + Operations, + TagSet, // + }, + error::{ + self, + from_err_ptr, + Result, // + }, + fmt::{ + self, + Write, // + }, prelude::*, static_lock_class, str::NullTerminatedFormatter, sync::Arc, - types::{ForeignOwnable, ScopeGuard}, + types::{ + ForeignOwnable, + ScopeGuard, // + }, // }; /// A builder for [`GenDisk`]. diff --git a/rust/kernel/block/mq/operations.rs b/rust/kernel/block/mq/operations.rs index 8ad46129a52c4..187b0b7791db9 100644 --- a/rust/kernel/block/mq/operations.rs +++ b/rust/kernel/block/mq/operations.rs @@ -6,11 +6,20 @@ use crate::{ bindings, - block::mq::{request::RequestDataWrapper, Request}, - error::{from_result, Result}, + block::mq::{ + request::RequestDataWrapper, + Request, // + }, + error::{ + from_result, + Result, // + }, prelude::*, - sync::{aref::ARef, Refcount}, - types::ForeignOwnable, + sync::{ + aref::ARef, + Refcount, // + }, + types::ForeignOwnable, // }; use core::marker::PhantomData; diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs index ce3e30c81cb5e..66254d02bba65 100644 --- a/rust/kernel/block/mq/request.rs +++ b/rust/kernel/block/mq/request.rs @@ -9,13 +9,19 @@ block::mq::Operations, error::Result, sync::{ - aref::{ARef, AlwaysRefCounted}, + aref::{ + ARef, + AlwaysRefCounted, // + }, atomic::Relaxed, - Refcount, + Refcount, // }, - types::Opaque, + types::Opaque, // +}; +use core::{ + marker::PhantomData, + ptr::NonNull, // }; -use core::{marker::PhantomData, ptr::NonNull}; /// A wrapper around a blk-mq [`struct request`]. This represents an IO request. /// diff --git a/rust/kernel/block/mq/tag_set.rs b/rust/kernel/block/mq/tag_set.rs index dae9df408a862..c1fd3e047af50 100644 --- a/rust/kernel/block/mq/tag_set.rs +++ b/rust/kernel/block/mq/tag_set.rs @@ -8,13 +8,27 @@ use crate::{ bindings, - block::mq::{operations::OperationsVTable, request::RequestDataWrapper, Operations}, - error::{self, Result}, + block::mq::{ + operations::OperationsVTable, + request::RequestDataWrapper, + Operations, // + }, + error::{ + self, + Result, // + }, prelude::try_pin_init, - types::Opaque, + types::Opaque, // +}; +use core::{ + convert::TryInto, + marker::PhantomData, // +}; +use pin_init::{ + pin_data, + pinned_drop, + PinInit, // }; -use core::{convert::TryInto, marker::PhantomData}; -use pin_init::{pin_data, pinned_drop, PinInit}; /// A wrapper for the C `struct blk_mq_tag_set`. /// -- 2.43.0