Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi use ACPI_INTEGER and PRIx64, and check success ...



details:   https://anonhg.NetBSD.org/src/rev/b104fe567744
branches:  trunk
changeset: 751936:b104fe567744
user:      cnst <cnst%NetBSD.org@localhost>
date:      Tue Feb 09 03:26:44 2010 +0000

description:
use ACPI_INTEGER and PRIx64, and check success of sensor_attach;    suggested by jruoho (Jukka Ruohonen)

diffstat:

 sys/dev/acpi/atk0110.c |  25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diffs (69 lines):

diff -r b9617612a394 -r b104fe567744 sys/dev/acpi/atk0110.c
--- a/sys/dev/acpi/atk0110.c    Tue Feb 09 03:19:50 2010 +0000
+++ b/sys/dev/acpi/atk0110.c    Tue Feb 09 03:26:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atk0110.c,v 1.1 2010/02/09 03:19:51 cnst Exp $ */
+/*     $NetBSD: atk0110.c,v 1.2 2010/02/09 03:26:44 cnst Exp $ */
 /*     $OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $        */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.1 2010/02/09 03:19:51 cnst Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.2 2010/02/09 03:26:44 cnst Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,9 +47,9 @@
 
 struct aibs_sensor {
        envsys_data_t   s;
-       int64_t         i;
-       int64_t         l;
-       int64_t         h;
+       ACPI_INTEGER    i;
+       ACPI_INTEGER    l;
+       ACPI_INTEGER    h;
 };
 
 struct aibs_softc {
@@ -252,11 +252,14 @@
                as[i].s.monitor = true;
 #endif
                aprint_verbose_dev(self, "%c%i: "
-                   "0x%08llx %20s %5lli / %5lli  0x%llx\n",
+                   "0x%08"PRIx64" %20s %5"PRIi64" / %5"PRIi64"  "
+                   "0x%"PRIx64"\n",
                    name[0], i,
-                   as[i].i, as[i].s.desc, as[i].l, as[i].h,
+                   as[i].i, as[i].s.desc, (int64_t)as[i].l, (int64_t)as[i].h,
                    oi[4].Integer.Value);
-               sysmon_envsys_sensor_attach(sc->sc_sme, &as[i].s);
+               if (sysmon_envsys_sensor_attach(sc->sc_sme, &as[i].s))
+                       aprint_error_dev(self, "%c%i: unable to attach\n",
+                           name[0], i);
        }
 
        AcpiOsFree(b.Pointer);
@@ -292,8 +295,8 @@
        int                     i;
        const char              *name;
        struct aibs_sensor      *as;
-       int64_t                 v;
-       int64_t                 l, h;
+       ACPI_INTEGER            v;
+       ACPI_INTEGER            l, h;
 
        switch (st) {
        case ENVSYS_STEMP:
@@ -398,7 +401,7 @@
        enum envsys_units       st = s->units;
        int                     i;
        struct aibs_sensor      *as;
-       int64_t                 l, h;
+       ACPI_INTEGER            l, h;
 
        switch (st) {
        case ENVSYS_STEMP:



Home | Main Index | Thread Index | Old Index