summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-06-24 13:55:51 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-08-14 23:40:32 +0200
commit491ffc1f7ce857b88e9d310ce901ce033e45b75d (patch)
treef008453be0e548f282b3928c71f279125cbc161d
parentfa0d653b06cec7b3188a733dc7394e030948018e (diff)
hw: fix mask for ColdFire UART command register
The "miscellaneous commands" part of the register is 3 bits wide. Spotted by Coverity and confirmed in the datasheet, downloadable from http://cache.freescale.com/files/32bit/doc/ref_manual/MCF5307BUM.pdf (figure 14-6). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/char/mcf_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 98fd44e66a..cda22eea5d 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -126,7 +126,7 @@ static void mcf_uart_do_tx(mcf_uart_state *s)
static void mcf_do_command(mcf_uart_state *s, uint8_t cmd)
{
/* Misc command. */
- switch ((cmd >> 4) & 3) {
+ switch ((cmd >> 4) & 7) {
case 0: /* No-op. */
break;
case 1: /* Reset mode register pointer. */