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 94B6F36C597; Thu, 6 Aug 2026 17:09:55 +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=1786036195; cv=none; b=hjR3UMw8xkkNKM3HwfakujjEqdXWxU86575G2I1T26mkP0rgPNydFBdUj1krjzzopSRLOXwQFciaC2duuPa3K9HM+WxIBvgAsAOk88100ZqdaJMNRK1UZk9Z5Oj4WciF35m1qMwqHk3RvBwcsVQCfwbx51qV73+OGYWJmFvOHFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786036195; c=relaxed/simple; bh=s/xpgHrjMnr3Dw/gDnMO8NhtKWrQpFIoMn7udGnLIvs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bGJoXgSHX6Xo/f6aq2biN+smRNs4YF6At79JmRQ/m1/3FJ3S+MTKAk+HxT/CEBQf4T+VbV2PFoZmEZ65MWCzs3AivCYnWHyV7qaCWh3I07vETGjVe7tDpoJszXCh80i/sue5P9ZEStNeWxh6zHujxUbzcQMPs7GkpypimC3Uhn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=c3jSDhDW; 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="c3jSDhDW" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3EF4CC2BCF6; Thu, 6 Aug 2026 17:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1786036195; bh=s/xpgHrjMnr3Dw/gDnMO8NhtKWrQpFIoMn7udGnLIvs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c3jSDhDWgeOznBerPbsu3ZcDP6xZU5/4WreMuqt4IqsmD0TDyBsx+jaJGOA09ADJM 1NJ7i83Q6pz8K/xP1HMgaDCWpfSBcuqP8UWh874XR/DmQLrk6cZLrw4zU52e5o7iib PYmHfp+AA65ogwXUfRQyPBWL624Ukla3G9EaHTzk= 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 1C1ABC56208; Thu, 6 Aug 2026 17:09:55 +0000 (UTC) From: Alvin Sun Date: Fri, 07 Aug 2026 01:07:23 +0800 Subject: [PATCH v3 1/8] rust: seq_file: add as_raw() method 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: 7bit Message-Id: <20260807-tyr-debugfs-v2-v3-1-ff5595ac66ae@linux.dev> References: <20260807-tyr-debugfs-v2-v3-0-ff5595ac66ae@linux.dev> In-Reply-To: <20260807-tyr-debugfs-v2-v3-0-ff5595ac66ae@linux.dev> To: Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?utf-8?q?Onur_=C3=96zkan?= , Greg Kroah-Hartman , "Rafael J. Wysocki" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Alexander Viro , Christian Brauner , Jan Kara , Matthew Brost , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev, dri-devel@lists.freedesktop.org, Alvin Sun X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786036192; l=882; i=alvin.sun@linux.dev; s=20260317; h=from:subject:message-id; bh=s/xpgHrjMnr3Dw/gDnMO8NhtKWrQpFIoMn7udGnLIvs=; b=0tjn5m4BoS1rIeOa3IpamfeD3PymWV6CSXh46fmc5jP6O99APRyjxXZX7OMXOZOBwcvkh7M+r jRxRl23LhU7BZd4vol8NhoDBjhbTPCYAlUg0PFJWUbJLi2pSmEEHtW7 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 Add a method to obtain a raw pointer to the underlying struct seq_file, needed for FFI calls into C (e.g. drm_debugfs_gpuva_info). Signed-off-by: Alvin Sun --- rust/kernel/seq_file.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/kernel/seq_file.rs b/rust/kernel/seq_file.rs index 518265558d66f..fbc75e0e77634 100644 --- a/rust/kernel/seq_file.rs +++ b/rust/kernel/seq_file.rs @@ -29,6 +29,12 @@ pub unsafe fn from_raw<'a>(ptr: *mut bindings::seq_file) -> &'a SeqFile { unsafe { &*ptr.cast() } } + /// Returns a raw pointer to the underlying `struct seq_file`. + #[inline] + pub fn as_raw(&self) -> *mut bindings::seq_file { + self.inner.get() + } + /// Used by the [`seq_print`] macro. #[inline] pub fn call_printf(&self, args: fmt::Arguments<'_>) { -- 2.43.0