Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Zhao Liu
> > > -pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> > > > std::ops::ControlFlow { > > > +fn regs_read(&mut self, offset: RegisterOffset) -> ControlFlow > > u32> { > > > use RegisterOffset::*; > > > > Can we move this "use" to the start of the file? > > I don't think

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Paolo Bonzini
On 1/22/25 15:34, Zhao Liu wrote: On Fri, Jan 17, 2025 at 10:26:50AM +0100, Paolo Bonzini wrote: Date: Fri, 17 Jan 2025 10:26:50 +0100 From: Paolo Bonzini Subject: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset X-Mailer: git-send-email 2.47.1 As an added bonus, this also

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:50AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:50 +0100 > From: Paolo Bonzini > Subject: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset > X-Mailer: git-send-email 2.47.1 > > As an added bonus, this also makes the n

[PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-17 Thread Paolo Bonzini
As an added bonus, this also makes the new function return u32 instead of u64, thus factoring some casts into a single place. Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 114 +-- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/r