public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] ACPI: Remove duplicate definitions for _STA bits
@ 2007-04-20 16:56 Bjorn Helgaas
  2007-04-25 18:16 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2007-04-20 16:56 UTC (permalink / raw)
  To: bjorn.helgaas, Len Brown
  Cc: linux-acpi, Andrew Morton, Naveen B S, Anil S Keshavamurthy,
	Paul Diefenbaugh

No need to duplicate the existing definitions in include/acpi/actypes.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: w/drivers/acpi/acpi_memhotplug.c
===================================================================
--- w.orig/drivers/acpi/acpi_memhotplug.c	2007-04-19 21:14:41.000000000 -0600
+++ w/drivers/acpi/acpi_memhotplug.c	2007-04-19 21:25:33.000000000 -0600
@@ -44,11 +44,6 @@
 MODULE_DESCRIPTION("Hotplug Mem Driver");
 MODULE_LICENSE("GPL");
 
-/* ACPI _STA method values */
-#define ACPI_MEMORY_STA_PRESENT		(0x00000001UL)
-#define ACPI_MEMORY_STA_ENABLED		(0x00000002UL)
-#define ACPI_MEMORY_STA_FUNCTIONAL	(0x00000008UL)
-
 /* Memory Device States */
 #define MEMORY_INVALID_STATE	0
 #define MEMORY_POWER_ON_STATE	1
@@ -204,9 +199,9 @@
 	 * Check for device status. Device should be
 	 * present/enabled/functioning.
 	 */
-	if (!((current_status & ACPI_MEMORY_STA_PRESENT)
-	      && (current_status & ACPI_MEMORY_STA_ENABLED)
-	      && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
+	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
+	      && (current_status & ACPI_STA_DEVICE_ENABLED)
+	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
 		return -ENODEV;
 
 	return 0;
@@ -286,7 +281,7 @@
 		return -ENODEV;
 
 	/* Check for device status.  Device should be disabled */
-	if (current_status & ACPI_MEMORY_STA_ENABLED)
+	if (current_status & ACPI_STA_DEVICE_ENABLED)
 		return -EINVAL;
 
 	return 0;
Index: w/drivers/acpi/container.c
===================================================================
--- w.orig/drivers/acpi/container.c	2007-04-19 21:14:41.000000000 -0600
+++ w/drivers/acpi/container.c	2007-04-19 21:14:44.000000000 -0600
@@ -49,8 +49,6 @@
 MODULE_DESCRIPTION("ACPI container driver");
 MODULE_LICENSE("GPL");
 
-#define ACPI_STA_PRESENT		(0x00000001)
-
 static int acpi_container_add(struct acpi_device *device);
 static int acpi_container_remove(struct acpi_device *device, int type);
 
@@ -75,13 +73,13 @@
 
 	status = acpi_get_handle(handle, "_STA", &temp);
 	if (ACPI_FAILURE(status))
-		return 1;	/* _STA not found, assmue device present */
+		return 1;	/* _STA not found, assume device present */
 
 	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
 	if (ACPI_FAILURE(status))
 		return 0;	/* Firmware error */
 
-	return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
+	return ((sta & ACPI_STA_DEVICE_PRESENT) == ACPI_STA_DEVICE_PRESENT);
 }
 
 /*******************************************************************/
Index: w/drivers/acpi/processor_core.c
===================================================================
--- w.orig/drivers/acpi/processor_core.c	2007-04-19 21:14:41.000000000 -0600
+++ w/drivers/acpi/processor_core.c	2007-04-19 21:14:44.000000000 -0600
@@ -71,8 +71,6 @@
 #define ACPI_PROCESSOR_LIMIT_USER	0
 #define ACPI_PROCESSOR_LIMIT_THERMAL	1
 
-#define ACPI_STA_PRESENT 0x00000001
-
 #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME("processor_core");
 
@@ -780,7 +778,7 @@
 
 
 	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
-	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
+	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) {
 		ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
 		return 0;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] ACPI: Remove duplicate definitions for _STA bits
  2007-04-20 16:56 [patch] ACPI: Remove duplicate definitions for _STA bits Bjorn Helgaas
@ 2007-04-25 18:16 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2007-04-25 18:16 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-acpi, Andrew Morton, Naveen B S, Anil S Keshavamurthy

Applied.

thanks,
-Len

On Friday 20 April 2007 12:56, Bjorn Helgaas wrote:
> No need to duplicate the existing definitions in include/acpi/actypes.h.
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 
> Index: w/drivers/acpi/acpi_memhotplug.c
> ===================================================================
> --- w.orig/drivers/acpi/acpi_memhotplug.c	2007-04-19 21:14:41.000000000 -0600
> +++ w/drivers/acpi/acpi_memhotplug.c	2007-04-19 21:25:33.000000000 -0600
> @@ -44,11 +44,6 @@
>  MODULE_DESCRIPTION("Hotplug Mem Driver");
>  MODULE_LICENSE("GPL");
>  
> -/* ACPI _STA method values */
> -#define ACPI_MEMORY_STA_PRESENT		(0x00000001UL)
> -#define ACPI_MEMORY_STA_ENABLED		(0x00000002UL)
> -#define ACPI_MEMORY_STA_FUNCTIONAL	(0x00000008UL)
> -
>  /* Memory Device States */
>  #define MEMORY_INVALID_STATE	0
>  #define MEMORY_POWER_ON_STATE	1
> @@ -204,9 +199,9 @@
>  	 * Check for device status. Device should be
>  	 * present/enabled/functioning.
>  	 */
> -	if (!((current_status & ACPI_MEMORY_STA_PRESENT)
> -	      && (current_status & ACPI_MEMORY_STA_ENABLED)
> -	      && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
> +	if (!((current_status & ACPI_STA_DEVICE_PRESENT)
> +	      && (current_status & ACPI_STA_DEVICE_ENABLED)
> +	      && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
>  		return -ENODEV;
>  
>  	return 0;
> @@ -286,7 +281,7 @@
>  		return -ENODEV;
>  
>  	/* Check for device status.  Device should be disabled */
> -	if (current_status & ACPI_MEMORY_STA_ENABLED)
> +	if (current_status & ACPI_STA_DEVICE_ENABLED)
>  		return -EINVAL;
>  
>  	return 0;
> Index: w/drivers/acpi/container.c
> ===================================================================
> --- w.orig/drivers/acpi/container.c	2007-04-19 21:14:41.000000000 -0600
> +++ w/drivers/acpi/container.c	2007-04-19 21:14:44.000000000 -0600
> @@ -49,8 +49,6 @@
>  MODULE_DESCRIPTION("ACPI container driver");
>  MODULE_LICENSE("GPL");
>  
> -#define ACPI_STA_PRESENT		(0x00000001)
> -
>  static int acpi_container_add(struct acpi_device *device);
>  static int acpi_container_remove(struct acpi_device *device, int type);
>  
> @@ -75,13 +73,13 @@
>  
>  	status = acpi_get_handle(handle, "_STA", &temp);
>  	if (ACPI_FAILURE(status))
> -		return 1;	/* _STA not found, assmue device present */
> +		return 1;	/* _STA not found, assume device present */
>  
>  	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
>  	if (ACPI_FAILURE(status))
>  		return 0;	/* Firmware error */
>  
> -	return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
> +	return ((sta & ACPI_STA_DEVICE_PRESENT) == ACPI_STA_DEVICE_PRESENT);
>  }
>  
>  /*******************************************************************/
> Index: w/drivers/acpi/processor_core.c
> ===================================================================
> --- w.orig/drivers/acpi/processor_core.c	2007-04-19 21:14:41.000000000 -0600
> +++ w/drivers/acpi/processor_core.c	2007-04-19 21:14:44.000000000 -0600
> @@ -71,8 +71,6 @@
>  #define ACPI_PROCESSOR_LIMIT_USER	0
>  #define ACPI_PROCESSOR_LIMIT_THERMAL	1
>  
> -#define ACPI_STA_PRESENT 0x00000001
> -
>  #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
>  ACPI_MODULE_NAME("processor_core");
>  
> @@ -780,7 +778,7 @@
>  
>  
>  	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
> -	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
> +	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) {
>  		ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
>  		return 0;
>  	}
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-25 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-20 16:56 [patch] ACPI: Remove duplicate definitions for _STA bits Bjorn Helgaas
2007-04-25 18:16 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox