[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-24
Subject:    ia64: ACPI tidy-up.
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2002-10-31 21:23:24
[Download RAW message or body]

ChangeSet 1.757.10.3, 2002/10/31 14:23:24-07:00, willy@fc.hp.com

	ia64: ACPI tidy-up.


# This patch includes the following deltas:
#	           ChangeSet	1.757.10.2 -> 1.757.10.3
#	arch/ia64/kernel/acpi.c	1.9     -> 1.10   
#

 acpi.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)


diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c	Wed Dec 18 11:33:14 2002
+++ b/arch/ia64/kernel/acpi.c	Wed Dec 18 11:33:14 2002
@@ -239,36 +239,35 @@
 		return status;
 	}
 
+	status = AE_NOT_FOUND;
 	res = (acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR);
 	if (!res) {
 		printk(KERN_ERR PREFIX "Failed to find config space for device\n");
-		acpi_os_free(buf.pointer);
-		return AE_NOT_FOUND;
+		goto out;
 	}
 
+	status = AE_TYPE; /* Revisit error? */
 	hp_res = (acpi_hp_vendor_long *)(res->reserved);
 
 	if (res->length != HP_CCSR_LENGTH || hp_res->guid_id != HP_CCSR_TYPE) {
 		printk(KERN_ERR PREFIX "Unknown Vendor data\n");
-		acpi_os_free(buf.pointer);
-		return AE_TYPE; /* Revisit error? */
+		goto out;
 	}
 
 	memcpy(&vendor_guid, hp_res->guid, sizeof(efi_guid_t));
 	if (efi_guidcmp(vendor_guid, HP_CCSR_GUID) != 0) {
 		printk(KERN_ERR PREFIX "Vendor GUID does not match\n");
-		acpi_os_free(buf.pointer);
-		return AE_TYPE; /* Revisit error? */
+		goto out;
 	}
 
-	for (i = 0 ; i < 8 ; i++) {
-		*csr_base |= ((u64)(hp_res->csr_base[i]) << (i * 8));
-		*csr_length |= ((u64)(hp_res->csr_length[i]) << (i * 8));
-	}
+	/* It's probably unaligned, so use memcpy */
+	memcpy(csr_base, hp_res->csr_base, 8);
+	memcpy(csr_length, hp_res->csr_length, 8);
+	status = AE_OK;
 
+ out:
 	acpi_os_free(buf.pointer);
-
-	return AE_OK;
+	return status;
 }
 #endif /* CONFIG_ACPI */
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic