rust: pl011: hide unnecessarily "pub" items from outside pl011::device

The only public interfaces for pl011 are TYPE_PL011 and pl011_create.
Remove pub from everything else.

Note: the "allow(dead_code)" is removed later.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-11-14 17:46:43 +01:00
parent efe5719c64
commit d1f27ae9ca
3 changed files with 10 additions and 7 deletions

View file

@ -573,7 +573,7 @@ impl PL011State {
} }
/// Which bits in the interrupt status matter for each outbound IRQ line ? /// Which bits in the interrupt status matter for each outbound IRQ line ?
pub const IRQMASK: [u32; 6] = [ const IRQMASK: [u32; 6] = [
/* combined IRQ */ /* combined IRQ */
Interrupt::E Interrupt::E
| Interrupt::MS | Interrupt::MS

View file

@ -19,7 +19,7 @@ extern "C" fn pl011_clock_needed(opaque: *mut c_void) -> bool {
} }
/// Migration subsection for [`PL011State`] clock. /// Migration subsection for [`PL011State`] clock.
pub static VMSTATE_PL011_CLOCK: VMStateDescription = VMStateDescription { static VMSTATE_PL011_CLOCK: VMStateDescription = VMStateDescription {
name: c_str!("pl011/clock").as_ptr(), name: c_str!("pl011/clock").as_ptr(),
version_id: 1, version_id: 1,
minimum_version_id: 1, minimum_version_id: 1,

View file

@ -27,9 +27,11 @@
use qemu_api::c_str; use qemu_api::c_str;
pub mod device; mod device;
pub mod device_class; mod device_class;
pub mod memory_ops; mod memory_ops;
pub use device::pl011_create;
pub const TYPE_PL011: &::std::ffi::CStr = c_str!("pl011"); pub const TYPE_PL011: &::std::ffi::CStr = c_str!("pl011");
pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr = c_str!("pl011_luminary"); pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr = c_str!("pl011_luminary");
@ -42,7 +44,7 @@ pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr = c_str!("pl011_luminary");
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[repr(u64)] #[repr(u64)]
#[derive(Debug, qemu_api_macros::TryInto)] #[derive(Debug, qemu_api_macros::TryInto)]
pub enum RegisterOffset { enum RegisterOffset {
/// Data Register /// Data Register
/// ///
/// A write to this register initiates the actual data transmission /// A write to this register initiates the actual data transmission
@ -98,7 +100,8 @@ pub enum RegisterOffset {
//Reserved = 0x04C, //Reserved = 0x04C,
} }
pub mod registers { #[allow(dead_code)]
mod registers {
//! Device registers exposed as typed structs which are backed by arbitrary //! Device registers exposed as typed structs which are backed by arbitrary
//! integer bitmaps. [`Data`], [`Control`], [`LineControl`], etc. //! integer bitmaps. [`Data`], [`Control`], [`LineControl`], etc.
use bilge::prelude::*; use bilge::prelude::*;