rust/pl011: move CLK_NAME static to function scope
authorManos Pitsidianakis <manos.pitsidianakis@linaro.org>
Thu, 24 Oct 2024 14:03:03 +0000 (17:03 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 13:18:16 +0000 (14:18 +0100)
We do not need to have CLK_NAME public nor a static. No functional change.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20241024-rust-round-2-v1-5-051e7a25b978@linaro.org
rust/hw/char/pl011/src/device.rs

index dd9145669dcae28af6ffc542e4821b484d487331..f91790ff185c8da2f991ede8b9b326b2d757a9b6 100644 (file)
@@ -102,9 +102,6 @@ impl qemu_api::definitions::Class for PL011Class {
     > = None;
 }
 
-#[used]
-pub static CLK_NAME: &CStr = c"clk";
-
 impl PL011State {
     /// Initializes a pre-allocated, unitialized instance of `PL011State`.
     ///
@@ -114,7 +111,9 @@ impl PL011State {
     /// `PL011State` type. It must not be called more than once on the same
     /// location/instance. All its fields are expected to hold unitialized
     /// values with the sole exception of `parent_obj`.
-    pub unsafe fn init(&mut self) {
+    unsafe fn init(&mut self) {
+        const CLK_NAME: &CStr = c"clk";
+
         let dev = addr_of_mut!(*self).cast::<DeviceState>();
         // SAFETY:
         //