qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1856549] Re: qemu-4.2.0/hw/misc/mac_via.c: 2 * bad test ?


From: Philippe Mathieu-Daudé
Subject: [Bug 1856549] Re: qemu-4.2.0/hw/misc/mac_via.c: 2 * bad test ?
Date: Mon, 16 Dec 2019 16:52:40 -0000

This code seems to emulate a RTC device connected via I2C to the VIA
chipset.

This might be the expected code (simply looking at this file, without checking 
the datasheet):
-- >8 --
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -409,7 +409,7 @@ static void via1_rtc_update(MacVIAState *m)
                 } else if (m->data_out == 0x8d) { /* seconds register 3 */
                     m->data_in = (time >> 24) & 0xff;
                     m->data_in_cnt = 8;
-                } else if ((m->data_out & 0xf3) == 0xa1) {
+                } else if ((m->data_out & 0xf3) == 0xa3) {
                     /* PRAM address 0x10 -> 0x13 */
                     int addr = (m->data_out >> 2) & 0x03;
                     m->data_in = v1s->PRAM[addr];
@@ -460,7 +460,7 @@ static void via1_rtc_update(MacVIAState *m)
                 } else if (m->cmd == 0x35) {
                     /* Write Protect register */
                     m->wprotect = m->data_out & 1;
-                } else if ((m->cmd & 0xf3) == 0xa1) {
+                } else if ((m->cmd & 0xf3) == 0xa3) {
                     /* PRAM address 0x10 -> 0x13 */
                     int addr = (m->cmd >> 2) & 0x03;
                     v1s->PRAM[addr] = m->data_out;
---

This file won a "/* TODO port to I2CBus */" comment :)

** Tags added: m68k rtc

** Tags added: i2c

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1856549

Title:
  qemu-4.2.0/hw/misc/mac_via.c: 2 * bad test ?

Status in QEMU:
  New

Bug description:
  1.

  qemu-4.2.0/hw/misc/mac_via.c:417:27: style: Expression is always false
  because 'else if' condition matches previous condition at line 412.
  [multiCondition]

                  } else if ((m->data_out & 0xf3) == 0xa1) {
  ...
                  } else if ((m->data_out & 0xf3) == 0xa1) {

  2.

  qemu-4.2.0/hw/misc/mac_via.c:467:27: style: Expression is always false
  because 'else if' condition matches previous condition at line 463.
  [multiCondition]

  Duplicate.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1856549/+subscriptions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]