diff mbox series

[05/11] rust/pl011: move CLK_NAME static to function scope

Message ID 20241024-rust-round-2-v1-5-051e7a25b978@linaro.org (mailing list archive)
State New
Headers show
Series Rust device model patches and misc cleanups | expand

Commit Message

Manos Pitsidianakis Oct. 24, 2024, 2:03 p.m. UTC
We do not need to have CLK_NAME public nor a static. No functional change.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 rust/hw/char/pl011/src/device.rs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index 57dc37dadef631fbccfa3049a3d8701b4e62b5b3..115786f9fa7f03c16cd44462cb7df5623ba3a6d7 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -152,6 +152,8 @@  impl ObjectImpl for PL011State {
     /// location/instance. All its fields are expected to hold unitialized
     /// values with the sole exception of `parent_obj`.
     unsafe fn instance_init(&mut self) {
+        const CLK_NAME: &CStr = c"clk";
+
         let dev = addr_of_mut!(*self).cast::<DeviceState>();
         // SAFETY:
         //
@@ -255,9 +257,6 @@  unsafe fn post_load(&mut self, _version_id: c_int) -> c_int {
     }
 }
 
-#[used]
-pub static CLK_NAME: &CStr = c"clk";
-
 impl PL011State {
     pub fn read(
         &mut self,