public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* acpi/sleep/proc.c
@ 2005-07-17 19:16 Pavel Machek
       [not found] ` <20050717191637.GA12674-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2005-07-17 19:16 UTC (permalink / raw)
  To: ACPI mailing list, Len Brown

This cleans up acpi/sleep/proc.c. It removes macros used just
once. Only code change is removing duplicated code in two branches of
if().

[As a side note, this should make akpm stop patchbombing you :-)]

Signed-off-by: Pavel Machek <pavel-AlSwsSmVLrQ@public.gmane.org>

diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -13,13 +13,6 @@
 
 #include "sleep.h"
 
-#ifdef	CONFIG_ACPI_SLEEP_PROC_SLEEP
-#define ACPI_SYSTEM_FILE_SLEEP		"sleep"
-#endif
-
-#define ACPI_SYSTEM_FILE_ALARM		"alarm"
-#define ACPI_SYSTEM_FILE_WAKEUP_DEVICE   "wakeup"
-
 #define _COMPONENT		ACPI_SYSTEM_COMPONENT
 ACPI_MODULE_NAME		("sleep")
 
@@ -378,14 +371,10 @@ acpi_system_wakeup_device_seq_show(struc
 		if (!dev->wakeup.flags.valid)
 			continue;
 		spin_unlock(&acpi_device_lock);
-		if (dev->wakeup.flags.run_wake)
-			seq_printf(seq, "%4s	%4d		%8s\n",
-				dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
-				dev->wakeup.state.enabled ? "*enabled" : "*disabled");
-		else
-			seq_printf(seq, "%4s	%4d		%8s\n",
-				dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
-				dev->wakeup.state.enabled ? "enabled" : "disabled");
+		seq_printf(seq, "%4s	%4d		%s%8s\n",
+			   dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
+			   dev->wakeup.flags.run_wake ? "*" : "",
+			   dev->wakeup.state.enabled ? "*enabled" : "*disabled");
 		spin_lock(&acpi_device_lock);
 	}
 	spin_unlock(&acpi_device_lock);
@@ -486,28 +475,25 @@ static u32 rtc_handler(void * context)
 
 static int acpi_sleep_proc_init(void)
 {
-	struct proc_dir_entry	*entry = NULL;
+	struct proc_dir_entry *entry = NULL;
 
 	if (acpi_disabled)
 		return 0;
  
 #ifdef	CONFIG_ACPI_SLEEP_PROC_SLEEP
-	/* 'sleep' [R/W]*/
-	entry = create_proc_entry(ACPI_SYSTEM_FILE_SLEEP,
-				  S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
+	/* 'sleep' [R/W] */
+	entry = create_proc_entry("sleep", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
 	if (entry)
 		entry->proc_fops = &acpi_system_sleep_fops;
 #endif
 
 	/* 'alarm' [R/W] */
-	entry = create_proc_entry(ACPI_SYSTEM_FILE_ALARM,
-		S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
+	entry = create_proc_entry("alarm", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
 	if (entry)
 		entry->proc_fops = &acpi_system_alarm_fops;
 
-	/* 'wakeup device' [R/W]*/
-	entry = create_proc_entry(ACPI_SYSTEM_FILE_WAKEUP_DEVICE,
-				  S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
+	/* 'wakeup device' [R/W] */
+	entry = create_proc_entry("wakeup", S_IFREG|S_IRUGO|S_IWUSR, acpi_root_dir);
 	if (entry)
 		entry->proc_fops = &acpi_system_wakeup_device_fops;
 

-- 
teflon -- maybe it is a trademark, but it should not be.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

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

* Re: acpi/sleep/proc.c
       [not found] ` <20050717191637.GA12674-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
@ 2005-07-18  0:52   ` Dmitry Torokhov
       [not found]     ` <200507171952.52881.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2005-07-18  0:52 UTC (permalink / raw)
  To: Pavel Machek; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Len Brown

Hi,

On Sunday 17 July 2005 14:16, Pavel Machek wrote:
> +		seq_printf(seq, "%4s	%4d		%s%8s\n",
> +			   dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
> +			   dev->wakeup.flags.run_wake ? "*" : "",
> +			   dev->wakeup.state.enabled ? "*enabled" : "*disabled");

Do you really want to have double astericks (**enabled)?

-- 
Dmitry


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

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

* Re: acpi/sleep/proc.c
       [not found]     ` <200507171952.52881.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
@ 2005-07-18 11:42       ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2005-07-18 11:42 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Len Brown

Hi!

> > +		seq_printf(seq, "%4s	%4d		%s%8s\n",
> > +			   dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
> > +			   dev->wakeup.flags.run_wake ? "*" : "",
> > +			   dev->wakeup.state.enabled ? "*enabled" : "*disabled");
> 
> Do you really want to have double astericks (**enabled)?

Oops, my bad. Just delete * from *enabled and *disabled:
							Pavel

diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -374,7 +374,7 @@ acpi_system_wakeup_device_seq_show(struc
 		seq_printf(seq, "%4s	%4d		%s%8s\n",
 			   dev->pnp.bus_id, (u32) dev->wakeup.sleep_state,
 			   dev->wakeup.flags.run_wake ? "*" : "",
-			   dev->wakeup.state.enabled ? "*enabled" : "*disabled");
+			   dev->wakeup.state.enabled ? "enabled" : "disabled");
 		spin_lock(&acpi_device_lock);
 	}
 	spin_unlock(&acpi_device_lock);


-- 
teflon -- maybe it is a trademark, but it should not be.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

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

end of thread, other threads:[~2005-07-18 11:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-17 19:16 acpi/sleep/proc.c Pavel Machek
     [not found] ` <20050717191637.GA12674-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-07-18  0:52   ` acpi/sleep/proc.c Dmitry Torokhov
     [not found]     ` <200507171952.52881.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2005-07-18 11:42       ` acpi/sleep/proc.c Pavel Machek

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