From a538892cac8e22f4aceafa52483207b2b7b611f9 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Tue, 15 Feb 2005 17:00:19 +0000 Subject: [PATCH] Avoid casts as lvalues. Obtained-from: FreeBSD --- sys/i386/acpica/acpi_wakeup.c | 14 +++++++------- sys/platform/pc32/acpica/acpi_wakeup.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index ffaa16b5ba..1a3b2573f3 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -23,7 +23,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * $DragonFly: src/sys/i386/acpica/Attic/acpi_wakeup.c,v 1.2 2004/02/12 23:33:26 joerg Exp $ + * $DragonFly: src/sys/i386/acpica/Attic/acpi_wakeup.c,v 1.3 2005/02/15 17:00:19 joerg Exp $ */ #include @@ -172,14 +172,14 @@ acpi_printcpu(void) } #define WAKECODE_FIXUP(offset, type, val) do { \ - void **addr; \ - addr = (void **)(sc->acpi_wakeaddr + offset); \ - (type *)*addr = val; \ + type *addr; \ + addr = (type *)(sc->acpi_wakeaddr + offset); \ + *addr = val; \ } while (0) #define WAKECODE_BCOPY(offset, type, val) do { \ - void **addr; \ - addr = (void **)(sc->acpi_wakeaddr + offset); \ + void *addr; \ + addr = (void *)(sc->acpi_wakeaddr + offset); \ bcopy(&(val), addr, sizeof(type)); \ } while (0) @@ -240,7 +240,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(previous_ldt, u_int16_t, r_ldt); WAKECODE_BCOPY(previous_idt, struct region_descriptor, r_idt); - WAKECODE_FIXUP(where_to_recover, void, acpi_restorecpu); + WAKECODE_FIXUP(where_to_recover, void *, acpi_restorecpu); WAKECODE_FIXUP(previous_ds, u_int16_t, r_ds); WAKECODE_FIXUP(previous_es, u_int16_t, r_es); diff --git a/sys/platform/pc32/acpica/acpi_wakeup.c b/sys/platform/pc32/acpica/acpi_wakeup.c index 6775c8a537..661efb25be 100644 --- a/sys/platform/pc32/acpica/acpi_wakeup.c +++ b/sys/platform/pc32/acpica/acpi_wakeup.c @@ -23,7 +23,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * $DragonFly: src/sys/platform/pc32/acpica/Attic/acpi_wakeup.c,v 1.2 2004/02/12 23:33:26 joerg Exp $ + * $DragonFly: src/sys/platform/pc32/acpica/Attic/acpi_wakeup.c,v 1.3 2005/02/15 17:00:19 joerg Exp $ */ #include @@ -172,14 +172,14 @@ acpi_printcpu(void) } #define WAKECODE_FIXUP(offset, type, val) do { \ - void **addr; \ - addr = (void **)(sc->acpi_wakeaddr + offset); \ - (type *)*addr = val; \ + type *addr; \ + addr = (type *)(sc->acpi_wakeaddr + offset); \ + *addr = val; \ } while (0) #define WAKECODE_BCOPY(offset, type, val) do { \ - void **addr; \ - addr = (void **)(sc->acpi_wakeaddr + offset); \ + void *addr; \ + addr = (void *)(sc->acpi_wakeaddr + offset); \ bcopy(&(val), addr, sizeof(type)); \ } while (0) @@ -240,7 +240,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(previous_ldt, u_int16_t, r_ldt); WAKECODE_BCOPY(previous_idt, struct region_descriptor, r_idt); - WAKECODE_FIXUP(where_to_recover, void, acpi_restorecpu); + WAKECODE_FIXUP(where_to_recover, void *, acpi_restorecpu); WAKECODE_FIXUP(previous_ds, u_int16_t, r_ds); WAKECODE_FIXUP(previous_es, u_int16_t, r_es); -- 2.41.0