hw/sh4/sh_pci.c: Use ldl_le_p() and stl_le_p()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 10 Jun 2016 16:10:21 +0000 (17:10 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Jun 2016 14:09:32 +0000 (15:09 +0100)
Use ldl_le_p() and stl_le_p() instead of le32_to_cpup() and
cpu_to_le32w(); the former handle misaligned addresses and don't
need casts, and the latter are deprecated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 1465575021-3774-1-git-send-email-peter.maydell@linaro.org

hw/sh4/sh_pci.c

index e820a323071ca034845541a0bffdc83c35d479c8..1747628f3d66a9bfcdd83e4da797584ea915db68 100644 (file)
@@ -55,7 +55,7 @@ static void sh_pci_reg_write (void *p, hwaddr addr, uint64_t val,
 
     switch(addr) {
     case 0 ... 0xfc:
-        cpu_to_le32w((uint32_t*)(pcic->dev->config + addr), val);
+        stl_le_p(pcic->dev->config + addr, val);
         break;
     case 0x1c0:
         pcic->par = val;
@@ -85,7 +85,7 @@ static uint64_t sh_pci_reg_read (void *p, hwaddr addr,
 
     switch(addr) {
     case 0 ... 0xfc:
-        return le32_to_cpup((uint32_t*)(pcic->dev->config + addr));
+        return ldl_le_p(pcic->dev->config + addr);
     case 0x1c0:
         return pcic->par;
     case 0x1c4: