Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Add missing pointer <-> integer casts



details:   https://anonhg.NetBSD.org/src/rev/7a24c2d3970d
branches:  trunk
changeset: 324716:7a24c2d3970d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 16 23:11:47 2018 +0000

description:
Add missing pointer <-> integer casts
Use PRI?64 to print uint64_t instead 'll?'

diffstat:

 sys/arch/arm/broadcom/bcm283x_platform.c |  19 ++++++++++---------
 sys/arch/arm/fdt/psci_fdt.c              |   6 +++---
 sys/arch/arm/nvidia/tegra210_car.c       |   7 ++++---
 sys/arch/arm/nvidia/tegra210_xusbpad.c   |   7 ++++---
 sys/arch/arm/nvidia/tegra_apbdma.c       |   7 ++++---
 sys/arch/arm/nvidia/tegra_cec.c          |   7 ++++---
 sys/arch/arm/nvidia/tegra_com.c          |   7 ++++---
 sys/arch/arm/nvidia/tegra_fuse.c         |   7 ++++---
 sys/arch/arm/nvidia/tegra_gpio.c         |   7 ++++---
 sys/arch/arm/nvidia/tegra_hdaudio.c      |   7 ++++---
 sys/arch/arm/nvidia/tegra_i2c.c          |   7 ++++---
 sys/arch/arm/nvidia/tegra_mc.c           |   7 ++++---
 sys/arch/arm/nvidia/tegra_pinmux.c       |   7 ++++---
 sys/arch/arm/nvidia/tegra_pmc.c          |   7 ++++---
 sys/arch/arm/nvidia/tegra_rtc.c          |   7 ++++---
 sys/arch/arm/nvidia/tegra_sdhc.c         |   7 ++++---
 sys/arch/arm/nvidia/tegra_soctherm.c     |   7 ++++---
 sys/arch/arm/nvidia/tegra_timer.c        |   7 ++++---
 sys/arch/arm/nvidia/tegra_usbphy.c       |   7 ++++---
 sys/arch/arm/nvidia/tegra_xusb.c         |  19 +++++++++++--------
 sys/arch/arm/rockchip/rk_gmac.c          |   6 ++++--
 sys/arch/arm/sunxi/sunxi_pwm.c           |   7 ++++---
 sys/arch/arm/sunxi/sunxi_rsb.c           |   8 ++++----
 sys/arch/arm/sunxi/sunxi_rtc.c           |  10 +++++-----
 24 files changed, 109 insertions(+), 85 deletions(-)

diffs (truncated from 759 to 300 lines):

diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/broadcom/bcm283x_platform.c
--- a/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.c,v 1.7 2018/07/09 06:21:46 ryo Exp $ */
+/*     $NetBSD: bcm283x_platform.c,v 1.8 2018/07/16 23:11:47 christos Exp $    */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.7 2018/07/09 06:21:46 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.8 2018/07/16 23:11:47 christos Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -616,7 +616,7 @@
        uint32_t res;
 
        bcm2835_mbox_write(iot, ioh, BCMMBOX_CHANARM2VC,
-           KERN_VTOPHYS(&vb_uart));
+           KERN_VTOPHYS((vaddr_t)&vb_uart));
 
        bcm2835_mbox_read(iot, ioh, BCMMBOX_CHANARM2VC, &res);
 
@@ -680,7 +680,8 @@
 #endif
            0) << 4);
 
-       bcm2835_mbox_write(iot, ioh, BCMMBOX_CHANARM2VC, KERN_VTOPHYS(&vb));
+       bcm2835_mbox_write(iot, ioh, BCMMBOX_CHANARM2VC,
+           KERN_VTOPHYS((vaddr_t)&vb));
 
        bcm2835_mbox_read(iot, ioh, BCMMBOX_CHANARM2VC, &res);
 
@@ -728,13 +729,13 @@
                printf("%s: board model  %x\n", __func__,
                    vb.vbt_boardmodel.model);
        if (vcprop_tag_success_p(&vb.vbt_macaddr.tag))
-               printf("%s: mac-address  %llx\n", __func__,
+               printf("%s: mac-address  %" PRIx64 "\n", __func__,
                    vb.vbt_macaddr.addr);
        if (vcprop_tag_success_p(&vb.vbt_boardrev.tag))
                printf("%s: board rev    %x\n", __func__,
                    vb.vbt_boardrev.rev);
        if (vcprop_tag_success_p(&vb.vbt_serial.tag))
-               printf("%s: board serial %llx\n", __func__,
+               printf("%s: board serial %" PRIx64 "\n", __func__,
                    vb.vbt_serial.sn);
        if (vcprop_tag_success_p(&vb.vbt_dmachan.tag))
                printf("%s: DMA channel mask 0x%08x\n", __func__,
@@ -803,12 +804,12 @@
                 */
                volatile uint64_t *cpu_release_addr;
 #define RPI3_ARMSTUB8_SPINADDR_BASE    0x000000d8
-               cpu_release_addr =
+               cpu_release_addr = (void *)
                    AARCH64_PA_TO_KVA(RPI3_ARMSTUB8_SPINADDR_BASE + i * 8);
-               *cpu_release_addr = aarch64_kern_vtophys(aarch64_mpstart);
+               *cpu_release_addr = aarch64_kern_vtophys((vaddr_t)aarch64_mpstart);
 
                /* need flush cache. secondary processors are cache disabled */
-               cpu_dcache_wb_range(cpu_release_addr, sizeof(cpu_release_addr));
+               cpu_dcache_wb_range((vaddr_t)cpu_release_addr, sizeof(cpu_release_addr));
                __asm __volatile("sev" ::: "memory");
 
 #if defined(VERBOSE_INIT_ARM) && defined(EARLYCONS)
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/fdt/psci_fdt.c
--- a/sys/arch/arm/fdt/psci_fdt.c       Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/fdt/psci_fdt.c       Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.9 2018/07/14 15:06:05 jmcneill Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.10 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.9 2018/07/14 15:06:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.10 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -168,7 +168,7 @@
 {
 #ifdef __aarch64__
        extern void aarch64_mpstart(void);
-       return (register_t)aarch64_kern_vtophys(aarch64_mpstart);
+       return (register_t)aarch64_kern_vtophys((vaddr_t)aarch64_mpstart);
 #else
        extern void cortex_mpstart(void);
        return (register_t)cortex_mpstart;
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra210_car.c
--- a/sys/arch/arm/nvidia/tegra210_car.c        Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra210_car.c        Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_car.c,v 1.17 2017/09/28 09:44:29 jmcneill Exp $ */
+/* $NetBSD: tegra210_car.c,v 1.18 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.17 2017/09/28 09:44:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.18 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -751,7 +751,8 @@
        sc->sc_bst = faa->faa_bst;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
        if (of_getprop_uint32(phandle, "#clock-cells", &sc->sc_clock_cells))
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra210_xusbpad.c
--- a/sys/arch/arm/nvidia/tegra210_xusbpad.c    Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra210_xusbpad.c    Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_xusbpad.c,v 1.8 2017/09/26 16:12:45 jmcneill Exp $ */
+/* $NetBSD: tegra210_xusbpad.c,v 1.9 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.8 2017/09/26 16:12:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.9 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -807,7 +807,8 @@
        sc->sc_bst = faa->faa_bst;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
 
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_apbdma.c
--- a/sys/arch/arm/nvidia/tegra_apbdma.c        Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_apbdma.c        Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_apbdma.c,v 1.4 2017/09/23 23:58:18 jmcneill Exp $ */
+/* $NetBSD: tegra_apbdma.c,v 1.5 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.4 2017/09/23 23:58:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.5 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -146,7 +146,8 @@
        sc->sc_phandle = phandle;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
        for (n = 0; n < TEGRA_APBDMA_NCHAN; n++) {
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_cec.c
--- a/sys/arch/arm/nvidia/tegra_cec.c   Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_cec.c   Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_cec.c,v 1.3 2015/12/22 22:10:36 jmcneill Exp $ */
+/* $NetBSD: tegra_cec.c,v 1.4 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.3 2015/12/22 22:10:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.4 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -151,7 +151,8 @@
        sc->sc_bst = faa->faa_bst;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
        mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_VM);
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_com.c
--- a/sys/arch/arm/nvidia/tegra_com.c   Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_com.c   Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_com.c,v 1.8 2017/06/02 13:53:29 jmcneill Exp $ */
+/* $NetBSD: tegra_com.c,v 1.9 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.8 2017/06/02 13:53:29 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.9 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -126,7 +126,8 @@
 
        error = bus_space_map(bst, addr, size, 0, &bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
 
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_fuse.c
--- a/sys/arch/arm/nvidia/tegra_fuse.c  Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_fuse.c  Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_fuse.c,v 1.5 2017/05/25 23:48:36 jmcneill Exp $ */
+/* $NetBSD: tegra_fuse.c,v 1.6 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.5 2017/05/25 23:48:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.6 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -99,7 +99,8 @@
        sc->sc_bst = faa->faa_bst;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
 
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_gpio.c
--- a/sys/arch/arm/nvidia/tegra_gpio.c  Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_gpio.c  Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_gpio.c,v 1.8 2017/05/25 23:50:22 jmcneill Exp $ */
+/* $NetBSD: tegra_gpio.c,v 1.9 2018/07/16 23:11:47 christos Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.8 2017/05/25 23:50:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.9 2018/07/16 23:11:47 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -178,7 +178,8 @@
        sc->sc_bst = faa->faa_bst;
        error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh);
        if (error) {
-               aprint_error(": couldn't map %#llx: %d", (uint64_t)addr, error);
+               aprint_error(": couldn't map %#" PRIx64 ": %d",
+                   (uint64_t)addr, error);
                return;
        }
 
diff -r f76cb50a4238 -r 7a24c2d3970d sys/arch/arm/nvidia/tegra_hdaudio.c
--- a/sys/arch/arm/nvidia/tegra_hdaudio.c       Mon Jul 16 23:10:41 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_hdaudio.c       Mon Jul 16 23:11:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_hdaudio.c,v 1.9 2017/09/27 10:50:06 jmcneill Exp $ */
+/* $NetBSD: tegra_hdaudio.c,v 1.10 2018/07/16 23:11:47 christos Exp $ */
 
 /*-



Home | Main Index | Thread Index | Old Index