aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManos Pitsidianakis <manos.pitsidianakis@linaro.org>2024-10-24 17:03:03 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2024-11-05 14:18:16 +0100
commit2e57bb6b27214fa96e3a340b342d8f653a92e8f9 (patch)
tree8cc7121cc69d76ac47e5ec1b31ccefc115bcc356
parent93243319db276bb424b7f9ad0bdfa8dc4b3368bd (diff)
downloadqemu-2e57bb6b27214fa96e3a340b342d8f653a92e8f9.zip
qemu-2e57bb6b27214fa96e3a340b342d8f653a92e8f9.tar.gz
qemu-2e57bb6b27214fa96e3a340b342d8f653a92e8f9.tar.bz2
rust/pl011: move CLK_NAME static to function scope
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
-rw-r--r--rust/hw/char/pl011/src/device.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index dd91456..f91790f 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -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:
//