Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Shorten the long lines with two custom macros.
details: https://anonhg.NetBSD.org/src/rev/38cf83e8526b
branches: trunk
changeset: 754167:38cf83e8526b
user: jruoho <jruoho%NetBSD.org@localhost>
date: Thu Apr 22 15:14:24 2010 +0000
description:
Shorten the long lines with two custom macros.
diffstat:
sys/dev/acpi/acpi_pci.c | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diffs (64 lines):
diff -r 1a20d6e2e073 -r 38cf83e8526b sys/dev/acpi/acpi_pci.c
--- a/sys/dev/acpi/acpi_pci.c Thu Apr 22 14:50:30 2010 +0000
+++ b/sys/dev/acpi/acpi_pci.c Thu Apr 22 15:14:24 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.6 2010/04/22 14:50:31 jruoho Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.7 2010/04/22 15:14:24 jruoho Exp $ */
/*
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.6 2010/04/22 14:50:31 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.7 2010/04/22 15:14:24 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -48,13 +48,16 @@
#include <dev/acpi/acpivar.h>
#include <dev/acpi/acpi_pci.h>
-#define _COMPONENT ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME ("acpi_pci")
+#define _COMPONENT ACPI_BUS_COMPONENT
+ACPI_MODULE_NAME ("acpi_pci")
-static ACPI_STATUS acpi_pcidev_pciroot_bus(ACPI_HANDLE, uint16_t *);
-static ACPI_STATUS acpi_pcidev_pciroot_bus_callback(ACPI_RESOURCE *,
- void *);
-static ACPI_STATUS acpi_pcidev_scan_rec(struct acpi_devnode *);
+#define ACPI_HILODWORD(x) ACPI_HIWORD(ACPI_LODWORD((x)))
+#define ACPI_LOLODWORD(x) ACPI_LOWORD(ACPI_LODWORD((x)))
+
+static ACPI_STATUS acpi_pcidev_pciroot_bus(ACPI_HANDLE, uint16_t *);
+static ACPI_STATUS acpi_pcidev_pciroot_bus_callback(ACPI_RESOURCE *,
+ void *);
+static ACPI_STATUS acpi_pcidev_scan_rec(struct acpi_devnode *);
/*
@@ -190,8 +193,8 @@
ap->ap_bus = 0;
}
- ap->ap_device = ACPI_HIWORD(ACPI_LODWORD(ad->ad_devinfo->Address));
- ap->ap_function = ACPI_LOWORD(ACPI_LODWORD(ad->ad_devinfo->Address));
+ ap->ap_device = ACPI_HILODWORD(ad->ad_devinfo->Address);
+ ap->ap_function = ACPI_LOLODWORD(ad->ad_devinfo->Address);
ap->ap_bridge = true;
ap->ap_downbus = ap->ap_bus;
@@ -214,8 +217,9 @@
ap->ap_segment = ad->ad_parent->ad_pciinfo->ap_segment;
ap->ap_bus = ad->ad_parent->ad_pciinfo->ap_downbus;
- ap->ap_device = ACPI_HIWORD(ACPI_LODWORD(ad->ad_devinfo->Address));
- ap->ap_function = ACPI_LOWORD(ACPI_LODWORD(ad->ad_devinfo->Address));
+
+ ap->ap_device = ACPI_HILODWORD(ad->ad_devinfo->Address);
+ ap->ap_function = ACPI_LOLODWORD(ad->ad_devinfo->Address);
/*
* Check whether this device is a PCI-to-PCI bridge and get its
Home |
Main Index |
Thread Index |
Old Index