[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/7] rust: pl011: fix break errors and definition of Data str
From: |
Zhao Liu |
Subject: |
Re: [PATCH 4/7] rust: pl011: fix break errors and definition of Data struct |
Date: |
Thu, 19 Dec 2024 15:17:49 +0800 |
On Thu, Dec 12, 2024 at 06:22:01PM +0100, Paolo Bonzini wrote:
> Date: Thu, 12 Dec 2024 18:22:01 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 4/7] rust: pl011: fix break errors and definition of Data
> struct
> X-Mailer: git-send-email 2.47.1
>
> The Data struct is wrong, and does not show how bits 8-15 of DR
> are the receive status. Fix it, and use it to fix break
> errors ("c >> 8" in the C code does not translate to
> "c.to_be_bytes()[3]").
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 15 ++++++------
> rust/hw/char/pl011/src/lib.rs | 41 ++++++++++++++++++++++----------
> 2 files changed, 36 insertions(+), 20 deletions(-)
> impl ReceiveStatusErrorClear {
> + pub fn set_from_data(&mut self, data: Data) {
> + self.set_errors(data.errors());
> + }
> +
This is the clear and clever way.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- [PATCH 0/7] rust: pl011: bug fixes, Paolo Bonzini, 2024/12/12
- [PATCH 1/7] rust: pl011: fix declaration of LineControl bits, Paolo Bonzini, 2024/12/12
- [PATCH 3/7] rust: pl011: always use reset() method on registers, Paolo Bonzini, 2024/12/12
- [PATCH 4/7] rust: pl011: fix break errors and definition of Data struct, Paolo Bonzini, 2024/12/12
- [PATCH 2/7] rust: pl011: match break logic of C version, Paolo Bonzini, 2024/12/12
- [PATCH 6/7] rust: pl011: fix migration stream, Paolo Bonzini, 2024/12/12
- [PATCH 5/7] rust: pl011: extend registers to 32 bits, Paolo Bonzini, 2024/12/12