qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC][MIPS][PATCH 3/6] Initial support of VIA IDE contr


From: Markus Armbruster
Subject: Re: [Qemu-devel] [RFC][MIPS][PATCH 3/6] Initial support of VIA IDE controller used by fulong mini pc
Date: Wed, 12 May 2010 09:33:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Blue Swirl <address@hidden> writes:

> On 5/11/10, Markus Armbruster <address@hidden> wrote:
>> Blue Swirl <address@hidden> writes:
>>
>>  > On 5/9/10, chen huacai <address@hidden> wrote:
>>  >> This patch add initial support of VIA IDE controller used by fulong mini 
>> pc
>>  >>
>>  >>  Signed-off-by: Huacai Chen <address@hidden>
>>  >>  -----
>>  [...]
>>
>> >>  diff --git a/hw/ide/via.c b/hw/ide/via.c
>>  >>  new file mode 100644
>>  >>  index 0000000..9adc5b5
>>  >>  --- /dev/null
>>  >>  +++ b/hw/ide/via.c
>>  >>  @@ -0,0 +1,189 @@
>>
>> [...]
>>
>> >>  +static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val)
>>  >>  +{
>>  >>  +    BMDMAState *bm = opaque;
>>  >>  +#ifdef DEBUG_IDE
>>  >>  +    printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val);
>>  >>  +#endif
>>  >>  +    switch(addr & 3) {
>>  >>  +    case 2:
>>  >>  +        bm->status = (val & 0x60) | (bm->status & 1) | (bm->status &
>>  >>  ~val & 0x06);
>>  >>  +        break;
>>  >
>>  > Some gccs complain if there is no default case.
>>
>>
>> Are you sure?  Which version?
>>
>>  It warns when the switch expression's type is an enumeration, and the
>>  switch doesn't handle all enumeration constants, and has no default
>>  case.
>>
>>  I can be made to warn whenever there's no default, but we don't do that.
>
> This problem came up with 299b520cd4092be3c53f8380b81315c33927d9d3
> (fixed before commit) and 4450521668471c7685551d8c5bcc582d754e9843,
> with mingw gcc and OpenBSD gccs.
[...]
>
> Maybe those cases were different from this.

The first commit you quoted is indeed different: the default prevents a
spurious warning: ‘context’ may be used uninitialized in this function
from some versions of gcc.  No such confusion can arise here.

In the second one, the switch expression is of enumeration type.



reply via email to

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