From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Subject: [PATCH] rust: pl011: fix device id matching
Date: Wed, 6 Nov 2024 19:51:36 +0100 [thread overview]
Message-ID: <20241106185136.582198-1-pbonzini@redhat.com> (raw)
The offset that is compared against 0x3f8..0x400 is not shifted right.
Adjust the pattern matching.
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/hw/char/pl011/src/device.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index 2a85960b81f..6556865fc22 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -182,7 +182,7 @@ pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> std::ops::ControlFlow<u
use RegisterOffset::*;
std::ops::ControlFlow::Break(match RegisterOffset::try_from(offset) {
- Err(v) if (0x3f8..0x400).contains(&v) => {
+ Err(v) if (0xfe0..=0xffc).contains(&v) => {
u64::from(self.device_id[(offset - 0xfe0) >> 2])
}
Err(_) => {
--
2.47.0
next reply other threads:[~2024-11-06 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 18:51 Paolo Bonzini [this message]
2024-11-06 22:56 ` [PATCH] rust: pl011: fix device id matching Philippe Mathieu-Daudé
2024-11-07 13:09 ` Manos Pitsidianakis
2024-11-07 13:33 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106185136.582198-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).