From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4DCDC55164 for ; Thu, 30 Jul 2026 17:05:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27F5C10EFF7; Thu, 30 Jul 2026 17:05:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.b="O4Ao7arJ"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B8BD10EFF7 for ; Thu, 30 Jul 2026 17:05:51 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 1BD3A43936; Thu, 30 Jul 2026 17:05:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D1817C2BCB9; Thu, 30 Jul 2026 17:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1785431150; bh=s/xpgHrjMnr3Dw/gDnMO8NhtKWrQpFIoMn7udGnLIvs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=O4Ao7arJNeeVq9ckYXQ0tqcqhcbIBJTyp7blBbOf95UHmJjvfn+4maqpQBRCjdm3G wS0oHJEEKXAlJk57dPeByPJjCCuCsHFeuOb/LzgTwoOWOK2ygNDonHUyNaCxnP45cT KqnqF/FZohcfaHzBT5UoSUIXkESUksnY1XCV0xT0= 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 B02D9C55162; Thu, 30 Jul 2026 17:05:50 +0000 (UTC) From: Alvin Sun Date: Fri, 31 Jul 2026 01:05:39 +0800 Subject: [PATCH v2 1/9] rust: seq_file: add as_raw() method MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260731-tyr-debugfs-v2-v2-1-aea19eccb996@linux.dev> References: <20260731-tyr-debugfs-v2-v2-0-aea19eccb996@linux.dev> In-Reply-To: <20260731-tyr-debugfs-v2-v2-0-aea19eccb996@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?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Melissa Wen , Wambui Karuga , Eric Anholt , Ben Gamari , 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=1785431148; l=882; i=alvin.sun@linux.dev; s=20260317; h=from:subject:message-id; bh=s/xpgHrjMnr3Dw/gDnMO8NhtKWrQpFIoMn7udGnLIvs=; b=RllQx43KbHuxgGco1sV76In+WKsRfcxUAilY4N3HdnKKwnLHutWJYha4dKAQ3SU4ikxcNuoVI X7YXbjya30dAzwLGJRoE2TzSdEk4DTVXOA7frGQiq4WSXNZaWgkas6X 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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