diff mbox

scsi/lsi53c895a: Remove unused lsi_mem_*() return value

Message ID 20170526014614.19840-1-maozy.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Mao Zhongyi May 26, 2017, 1:46 a.m. UTC
lsi_mem_read/write() always return 0 about which their
callers actually don't care. Change the function type
to void.

Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
---
 hw/scsi/lsi53c895a.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Paolo Bonzini May 26, 2017, 9:33 a.m. UTC | #1
On 26/05/2017 03:46, Mao Zhongyi wrote:
> lsi_mem_read/write() always return 0 about which their
> callers actually don't care. Change the function type
> to void.
> 
> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
> ---
>  hw/scsi/lsi53c895a.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
> index 595c260..3e56ab2 100644
> --- a/hw/scsi/lsi53c895a.c
> +++ b/hw/scsi/lsi53c895a.c
> @@ -408,27 +408,25 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);
>  static void lsi_execute_script(LSIState *s);
>  static void lsi_reselect(LSIState *s, lsi_request *p);
>  
> -static inline int lsi_mem_read(LSIState *s, dma_addr_t addr,
> +static inline void lsi_mem_read(LSIState *s, dma_addr_t addr,
>                                 void *buf, dma_addr_t len)
>  {
>      if (s->dmode & LSI_DMODE_SIOM) {
>          address_space_read(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
>                             buf, len);
> -        return 0;
>      } else {
> -        return pci_dma_read(PCI_DEVICE(s), addr, buf, len);
> +        pci_dma_read(PCI_DEVICE(s), addr, buf, len);
>      }
>  }
>  
> -static inline int lsi_mem_write(LSIState *s, dma_addr_t addr,
> +static inline void lsi_mem_write(LSIState *s, dma_addr_t addr,
>                                  const void *buf, dma_addr_t len)
>  {
>      if (s->dmode & LSI_DMODE_DIOM) {
>          address_space_write(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
>                              buf, len);
> -        return 0;
>      } else {
> -        return pci_dma_write(PCI_DEVICE(s), addr, buf, len);
> +        pci_dma_write(PCI_DEVICE(s), addr, buf, len);
>      }
>  }
>  
> 

Cc: qemu-trivial@nongnu.org
Michael Tokarev June 1, 2017, 9:45 a.m. UTC | #2
26.05.2017 04:46, Mao Zhongyi wrote:
> lsi_mem_read/write() always return 0 about which their
> callers actually don't care. Change the function type
> to void.

Applied to -trivial, thanks!

/mjt
diff mbox

Patch

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 595c260..3e56ab2 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -408,27 +408,25 @@  static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);
 static void lsi_execute_script(LSIState *s);
 static void lsi_reselect(LSIState *s, lsi_request *p);
 
-static inline int lsi_mem_read(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_read(LSIState *s, dma_addr_t addr,
                                void *buf, dma_addr_t len)
 {
     if (s->dmode & LSI_DMODE_SIOM) {
         address_space_read(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
                            buf, len);
-        return 0;
     } else {
-        return pci_dma_read(PCI_DEVICE(s), addr, buf, len);
+        pci_dma_read(PCI_DEVICE(s), addr, buf, len);
     }
 }
 
-static inline int lsi_mem_write(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_write(LSIState *s, dma_addr_t addr,
                                 const void *buf, dma_addr_t len)
 {
     if (s->dmode & LSI_DMODE_DIOM) {
         address_space_write(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
                             buf, len);
-        return 0;
     } else {
-        return pci_dma_write(PCI_DEVICE(s), addr, buf, len);
+        pci_dma_write(PCI_DEVICE(s), addr, buf, len);
     }
 }