Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Fix 32bit build.



details:   https://anonhg.NetBSD.org/src/rev/1cbea4cbcceb
branches:  trunk
changeset: 995511:1cbea4cbcceb
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed Dec 26 06:45:58 2018 +0000

description:
Fix 32bit build.

diffstat:

 sys/dev/acpi/ipmi_acpi.c |  14 +++++++++++---
 sys/dev/ipmi.c           |   9 +++++----
 2 files changed, 16 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r fb014e5f13c0 -r 1cbea4cbcceb sys/dev/acpi/ipmi_acpi.c
--- a/sys/dev/acpi/ipmi_acpi.c  Wed Dec 26 06:37:31 2018 +0000
+++ b/sys/dev/acpi/ipmi_acpi.c  Wed Dec 26 06:45:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipmi_acpi.c,v 1.1 2018/12/25 11:56:14 mlelstv Exp $ */
+/* $NetBSD: ipmi_acpi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipmi_acpi.c,v 1.1 2018/12/25 11:56:14 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipmi_acpi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -92,6 +92,7 @@
 #endif
        struct ipmi_attach_args IA, *ia = &IA;
        bus_addr_t reg2;
+       uint16_t i2caddr;
 
        sc->sc_dev = self;
 
@@ -173,7 +174,14 @@
                        aprint_error_dev(self, "no resources\n");
                        return;
                }
-               aprint_normal(": i2c 0x%lx\n", adr);
+               if (adr > 65535) {
+                       aprint_normal("\n");
+                       aprint_error_dev(self, "i2c address out of range\n");
+                       return;
+               }
+               i2caddr = adr;
+
+               aprint_normal(": i2c 0x%x\n", i2caddr);
                break;
        default:
                aprint_normal("\n");
diff -r fb014e5f13c0 -r 1cbea4cbcceb sys/dev/ipmi.c
--- a/sys/dev/ipmi.c    Wed Dec 26 06:37:31 2018 +0000
+++ b/sys/dev/ipmi.c    Wed Dec 26 06:45:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipmi.c,v 1.1 2018/12/25 11:56:13 mlelstv Exp $ */
+/*     $NetBSD: ipmi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.1 2018/12/25 11:56:13 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1851,7 +1851,7 @@
                    "ipmi0";
                aprint_error("%s: %s:bus_space_map(..., %" PRIx64 ", %x"
                    ", 0, %p) type %c failed %d\n",
-                   xname, __func__, ia->iaa_if_iobase,
+                   xname, __func__, (uint64_t)ia->iaa_if_iobase,
                    sc->sc_if->nregs * sc->sc_if_iospacing, &sc->sc_ioh,
                    ia->iaa_if_iotype, error);
                return -1;
@@ -2000,7 +2000,8 @@
        aprint_verbose_dev(self, "version %d.%d interface %s %sbase "
            "0x%" PRIx64 "/%#x spacing %d\n",
            ia->iaa_if_rev >> 4, ia->iaa_if_rev & 0xF, sc->sc_if->name,
-           ia->iaa_if_iotype == 'i' ? "io" : "mem", ia->iaa_if_iobase,
+           ia->iaa_if_iotype == 'i' ? "io" : "mem",
+           (uint64_t)ia->iaa_if_iobase,
            ia->iaa_if_iospacing * sc->sc_if->nregs, ia->iaa_if_iospacing);
        if (ia->iaa_if_irq != -1)
                aprint_verbose_dev(self, " irq %d\n", ia->iaa_if_irq);



Home | Main Index | Thread Index | Old Index