[PATCH 6/6] rust: page: Make Page::as_ptr() pub(crate)
From: Asahi Lina
Date: Sun Feb 02 2025 - 08:07:21 EST
There's no good reason for drivers to need access to the raw `struct
page` pointer, since that should be handled by Rust abstractions. Make
this method pub(crate) so it is only visible to the kernel crate.
Signed-off-by: Asahi Lina <lina@xxxxxxxxxxxxx>
---
rust/kernel/page.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/page.rs b/rust/kernel/page.rs
index 67cd7006fa63ab5aed4c4de2be639ed8e1fbc2ba..b7bce033b53682eca6e61f47e4fd3aa902da7900 100644
--- a/rust/kernel/page.rs
+++ b/rust/kernel/page.rs
@@ -83,7 +83,7 @@ pub fn alloc_page(flags: Flags) -> Result<Owned<Self>, AllocError> {
}
/// Returns a raw pointer to the page.
- pub fn as_ptr(&self) -> *mut bindings::page {
+ pub(crate) fn as_ptr(&self) -> *mut bindings::page {
Opaque::raw_get(&self.page)
}
--
2.47.1