Source-Changes-HG archive

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

[.joined/src/trunk]: .joined/src/sys/dev/acpi thinkpad(4): Omit workaround fo...



details:   https://anonhg.NetBSD.org/.joined/src/rev/163f71aa0d7d
branches:  trunk
changeset: 359360:163f71aa0d7d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Dec 31 17:22:35 2021 +0000

description:
thinkpad(4): Omit workaround for acpiec_bus_read.

acpiec_bus_read now initializes the whole ACPI_INTEGER like its
signature suggests, so we don't need to pick out the low bits of the
result or carefully avoid undefined behaviour from uninitialized
stack garbage.

diffstat:

 sys/dev/acpi/thinkpad_acpi.c |  10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diffs (31 lines):

diff -r 79c4e86a68dc -r 163f71aa0d7d sys/dev/acpi/thinkpad_acpi.c
--- a/sys/dev/acpi/thinkpad_acpi.c      Fri Dec 31 17:22:25 2021 +0000
+++ b/sys/dev/acpi/thinkpad_acpi.c      Fri Dec 31 17:22:35 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.53 2021/05/30 11:24:10 riastradh Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.54 2021/12/31 17:22:35 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.53 2021/05/30 11:24:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.54 2021/12/31 17:22:35 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -803,12 +803,6 @@
                return;
        }
 
-       /*
-        * Extract the low bytes from buffers
-        */
-       lo = ((uint8_t *)&lo)[0];
-       hi = ((uint8_t *)&hi)[0];
-
        rpm = ((((int)hi) << 8) | ((int)lo));
        if (rpm < 0) {
                edata->state = ENVSYS_SINVALID;



Home | Main Index | Thread Index | Old Index