diff mbox

[for-2.3,1/6] sb16: remove useless mixer_write_indexw

Message ID 1427715918-25768-2-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini March 30, 2015, 11:45 a.m. UTC
ioport.c is already able to split a 16-bit access into two 8-bit
accesses to consecutive ports.  Tested with Epic Pinball.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/audio/sb16.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Andreas Färber March 31, 2015, 11:19 a.m. UTC | #1
Am 30.03.2015 um 13:45 schrieb Paolo Bonzini:
> ioport.c is already able to split a 16-bit access into two 8-bit
> accesses to consecutive ports.  Tested with Epic Pinball.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/audio/sb16.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
> index 444eb9e..b052de5 100644
> --- a/hw/audio/sb16.c
> +++ b/hw/audio/sb16.c
> @@ -1121,12 +1121,6 @@ static IO_WRITE_PROTO (mixer_write_datab)
>      s->mixer_regs[s->mixer_nreg] = val;
>  }
>  
> -static IO_WRITE_PROTO (mixer_write_indexw)
> -{
> -    mixer_write_indexb (opaque, nport, val & 0xff);
> -    mixer_write_datab (opaque, nport, (val >> 8) & 0xff);
> -}

I assume you've verified the endianness handling, too?

Reviewed-by: Andreas Färber <afaerber@suse.de>

Regards,
Andreas
Paolo Bonzini March 31, 2015, 11:21 a.m. UTC | #2
On 31/03/2015 13:19, Andreas Färber wrote:
> Am 30.03.2015 um 13:45 schrieb Paolo Bonzini:
>> ioport.c is already able to split a 16-bit access into two 8-bit
>> accesses to consecutive ports.  Tested with Epic Pinball.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  hw/audio/sb16.c | 7 -------
>>  1 file changed, 7 deletions(-)
>>
>> diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
>> index 444eb9e..b052de5 100644
>> --- a/hw/audio/sb16.c
>> +++ b/hw/audio/sb16.c
>> @@ -1121,12 +1121,6 @@ static IO_WRITE_PROTO (mixer_write_datab)
>>      s->mixer_regs[s->mixer_nreg] = val;
>>  }
>>  
>> -static IO_WRITE_PROTO (mixer_write_indexw)
>> -{
>> -    mixer_write_indexb (opaque, nport, val & 0xff);
>> -    mixer_write_datab (opaque, nport, (val >> 8) & 0xff);
>> -}
> 
> I assume you've verified the endianness handling, too?

Yes, it's little-endian in either case:

        mrp->write(mrpio->portio_opaque, mrp->base + addr, data & 0xff);
        mrp->write(mrpio->portio_opaque, mrp->base + addr + 1, data >> 8);

for the sb16, index is 0x224 and data is 0x225.

Paolo
diff mbox

Patch

diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 444eb9e..b052de5 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -1121,12 +1121,6 @@  static IO_WRITE_PROTO (mixer_write_datab)
     s->mixer_regs[s->mixer_nreg] = val;
 }
 
-static IO_WRITE_PROTO (mixer_write_indexw)
-{
-    mixer_write_indexb (opaque, nport, val & 0xff);
-    mixer_write_datab (opaque, nport, (val >> 8) & 0xff);
-}
-
 static IO_READ_PROTO (mixer_read)
 {
     SB16State *s = opaque;
@@ -1345,7 +1339,6 @@  static const VMStateDescription vmstate_sb16 = {
 
 static const MemoryRegionPortio sb16_ioport_list[] = {
     {  4, 1, 1, .write = mixer_write_indexb },
-    {  4, 1, 2, .write = mixer_write_indexw },
     {  5, 1, 1, .read = mixer_read, .write = mixer_write_datab },
     {  6, 1, 1, .read = dsp_read, .write = dsp_write },
     { 10, 1, 1, .read = dsp_read },