Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Remove unnecessary casts.
details: https://anonhg.NetBSD.org/src/rev/18a20fe1f343
branches: trunk
changeset: 753799:18a20fe1f343
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Apr 10 18:32:13 2010 +0000
description:
Remove unnecessary casts.
diffstat:
sys/dev/acpi/acpi_powerres.c | 8 ++++----
sys/dev/acpi/dalb_acpi.c | 8 +++++---
sys/dev/acpi/fdc_acpi.c | 8 ++++----
sys/dev/acpi/vald_acpi.c | 10 +++++-----
4 files changed, 18 insertions(+), 16 deletions(-)
diffs (153 lines):
diff -r a4c54f855053 -r 18a20fe1f343 sys/dev/acpi/acpi_powerres.c
--- a/sys/dev/acpi/acpi_powerres.c Sat Apr 10 18:14:54 2010 +0000
+++ b/sys/dev/acpi/acpi_powerres.c Sat Apr 10 18:32:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_powerres.c,v 1.11 2010/03/05 14:00:17 jruoho Exp $ */
+/* $NetBSD: acpi_powerres.c,v 1.12 2010/04/10 18:32:13 jruoho Exp $ */
/*-
* Copyright (c) 2001 Michael Smith
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_powerres.c,v 1.11 2010/03/05 14:00:17 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_powerres.c,v 1.12 2010/04/10 18:32:13 jruoho Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@@ -367,7 +367,7 @@
status = acpi_eval_struct(pr0_handle, NULL, &reslist_buffer);
if (ACPI_FAILURE(status))
goto bad;
- reslist_object = (ACPI_OBJECT *)reslist_buffer.Pointer;
+ reslist_object = reslist_buffer.Pointer;
if ((reslist_object->Type != ACPI_TYPE_PACKAGE) ||
(reslist_object->Package.Count == 0)) {
goto bad;
@@ -388,7 +388,7 @@
acpi_name(reslist_handle)));
goto out;
}
- reslist_object = (ACPI_OBJECT *)reslist_buffer.Pointer;
+ reslist_object = reslist_buffer.Pointer;
if (reslist_object->Type != ACPI_TYPE_PACKAGE) {
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "resource list is not ACPI_TYPE_PACKAGE (%u)\n",
reslist_object->Type));
diff -r a4c54f855053 -r 18a20fe1f343 sys/dev/acpi/dalb_acpi.c
--- a/sys/dev/acpi/dalb_acpi.c Sat Apr 10 18:14:54 2010 +0000
+++ b/sys/dev/acpi/dalb_acpi.c Sat Apr 10 18:32:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dalb_acpi.c,v 1.11 2010/04/09 15:45:59 jruoho Exp $ */
+/* $NetBSD: dalb_acpi.c,v 1.12 2010/04/10 18:32:13 jruoho Exp $ */
/*-
* Copyright (c) 2008 Christoph Egger <cegger%netbsd.org@localhost>
@@ -27,7 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dalb_acpi.c,v 1.11 2010/04/09 15:45:59 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dalb_acpi.c,v 1.12 2010/04/10 18:32:13 jruoho Exp $");
/*
* Direct Application Launch Button:
@@ -112,6 +112,7 @@
ACPI_BUFFER ret;
rv = acpi_eval_struct(sc->sc_node->ad_handle, "GHID", &ret);
+
if (ACPI_FAILURE(rv) || ret.Pointer == NULL) {
aprint_error_dev(dev,
"couldn't enable notify handler: (%s)\n",
@@ -119,7 +120,8 @@
return;
}
- obj = (ACPI_OBJECT *)ret.Pointer;
+ obj = ret.Pointer;
+
if (obj->Type != ACPI_TYPE_BUFFER) {
sc->sc_usageid = DALB_ID_INVALID;
aprint_debug_dev(dev, "invalid ACPI type: %u\n", obj->Type);
diff -r a4c54f855053 -r 18a20fe1f343 sys/dev/acpi/fdc_acpi.c
--- a/sys/dev/acpi/fdc_acpi.c Sat Apr 10 18:14:54 2010 +0000
+++ b/sys/dev/acpi/fdc_acpi.c Sat Apr 10 18:32:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdc_acpi.c,v 1.38 2010/03/05 14:00:17 jruoho Exp $ */
+/* $NetBSD: fdc_acpi.c,v 1.39 2010/04/10 18:32:13 jruoho Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.38 2010/03/05 14:00:17 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.39 2010/04/10 18:32:13 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -236,7 +236,7 @@
#endif
return drives;
}
- fde = (ACPI_OBJECT *)abuf.Pointer;
+ fde = abuf.Pointer;
if (fde->Type != ACPI_TYPE_BUFFER) {
aprint_error_dev(sc->sc_dev, "expected BUFFER, got %u\n",
fde->Type);
@@ -302,7 +302,7 @@
sc->sc_knownfds[i] = &fdc_acpi_fdtypes[0];
continue;
}
- fdi = (ACPI_OBJECT *)abuf.Pointer;
+ fdi = abuf.Pointer;
if (fdi->Type != ACPI_TYPE_PACKAGE) {
aprint_error_dev(sc->sc_dev,
"expected PACKAGE, got %u\n", fdi->Type);
diff -r a4c54f855053 -r 18a20fe1f343 sys/dev/acpi/vald_acpi.c
--- a/sys/dev/acpi/vald_acpi.c Sat Apr 10 18:14:54 2010 +0000
+++ b/sys/dev/acpi/vald_acpi.c Sat Apr 10 18:32:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vald_acpi.c,v 1.1 2010/04/10 17:55:24 jruoho Exp $ */
+/* $NetBSD: vald_acpi.c,v 1.2 2010/04/10 18:32:13 jruoho Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vald_acpi.c,v 1.1 2010/04/10 17:55:24 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vald_acpi.c,v 1.2 2010/04/10 18:32:13 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -348,7 +348,7 @@
*result = GHCI_NOT_SUPPORT;
*value = 0;
- param = (ACPI_OBJECT *)buf.Pointer;
+ param = buf.Pointer;
if (param->Type == ACPI_TYPE_PACKAGE) {
PrtElement = param->Package.Elements;
if (PrtElement->Type == ACPI_TYPE_INTEGER)
@@ -405,7 +405,7 @@
}
*result = GHCI_NOT_SUPPORT;
- param = (ACPI_OBJECT *)buf.Pointer;
+ param = buf.Pointer;
if (param->Type == ACPI_TYPE_PACKAGE) {
PrtElement = param->Package.Elements;
if (PrtElement->Type == ACPI_TYPE_INTEGER)
@@ -438,7 +438,7 @@
return (AE_OK);
sc->lcd_handle = handle;
- param = (ACPI_OBJECT *)buf.Pointer;
+ param = buf.Pointer;
if (param->Type == ACPI_TYPE_PACKAGE) {
printf("_BCL retrun: %d packages\n", param->Package.Count);
Home |
Main Index |
Thread Index |
Old Index