public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's
  2006-01-04 22:01 [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's Ben Collins
@ 2006-01-04 19:34 ` Kristian Mueller
  2006-01-05 14:17   ` Ben Collins
  0 siblings, 1 reply; 4+ messages in thread
From: Kristian Mueller @ 2006-01-04 19:34 UTC (permalink / raw)
  To: Ben Collins; +Cc: linux-kernel

Hi Ben

On Mi, 2006-01-04 at 17:01 -0500, Ben Collins wrote:
> Basically completes what's already in the rest of the driver.
> sleep_in_progress is only defined for pm+ppc32.
> 
> Signed-off-by: Ben Collins <bcollins@ubuntu.com>

We've already found a different solution to this in the Linuxppc-dev
list.

See:
 http://patchwork.ozlabs.org/linuxppc/patch?id=3737


Fix compilation of via-pmu.c without Power Management support.

Signed-off-by: Kristian Mueller <Kristian-M@Kristian-M.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

---

--- linux/drivers/macintosh/via-pmu.c.orig2005-12-15 11:28:28.000000000
+0800
+++ linux/drivers/macintosh/via-pmu.c2005-12-15 12:20:43.000000000 +0800
@@ -157,8 +157,8 @@ static int pmu_version;
 static int drop_interrupts;
 #if defined(CONFIG_PM) && defined(CONFIG_PPC32)
 static int option_lid_wakeup = 1;
-static int sleep_in_progress;
 #endif /* CONFIG_PM && CONFIG_PPC32 */
+static int sleep_in_progress;
 static unsigned long async_req_locks;
 static unsigned int pmu_irq_stats[11];



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

* [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's
@ 2006-01-04 22:01 Ben Collins
  2006-01-04 19:34 ` Kristian Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Collins @ 2006-01-04 22:01 UTC (permalink / raw)
  To: linux-kernel

Basically completes what's already in the rest of the driver.
sleep_in_progress is only defined for pm+ppc32.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>

---

 drivers/macintosh/via-pmu.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

3ab202d5d55c3ea17d88454b212a0363f9a2b115
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 5640435..64549ad 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2911,8 +2911,10 @@ pmu_ioctl(struct inode * inode, struct f
 	 * the fbdev
 	 */
 	case PMU_IOC_GET_BACKLIGHT:
+#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
 		if (sleep_in_progress)
 			return -EBUSY;
+#endif
 		error = get_backlight_level();
 		if (error < 0)
 			return error;
@@ -2920,8 +2922,10 @@ pmu_ioctl(struct inode * inode, struct f
 	case PMU_IOC_SET_BACKLIGHT:
 	{
 		__u32 value;
+#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
 		if (sleep_in_progress)
 			return -EBUSY;
+#endif
 		error = get_user(value, argp);
 		if (!error)
 			error = set_backlight_level(value);
-- 
1.0.5

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

* Re: [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's
  2006-01-04 19:34 ` Kristian Mueller
@ 2006-01-05 14:17   ` Ben Collins
  2006-01-05 17:22     ` Kristian Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Collins @ 2006-01-05 14:17 UTC (permalink / raw)
  To: Kristian Mueller; +Cc: linux-kernel

On Thu, 2006-01-05 at 03:34 +0800, Kristian Mueller wrote:
> Hi Ben
> 
> On Mi, 2006-01-04 at 17:01 -0500, Ben Collins wrote:
> > Basically completes what's already in the rest of the driver.
> > sleep_in_progress is only defined for pm+ppc32.
> > 
> > Signed-off-by: Ben Collins <bcollins@ubuntu.com>
> 
> We've already found a different solution to this in the Linuxppc-dev
> list.
> 
> See:
>  http://patchwork.ozlabs.org/linuxppc/patch?id=3737

That patch makes no sense. It just moves the variable out of the ifdef,
but if CONFIG_PM or CONFIG_PPC32 is not enabled, then the variable never
gets modified, and so is always 0. Why not just wrap all the code that
uses it (like my patch did)?

-- 
   Ben Collins <ben.collins@ubuntu.com>
   Developer
   Ubuntu Linux


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

* Re: [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's
  2006-01-05 14:17   ` Ben Collins
@ 2006-01-05 17:22     ` Kristian Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Kristian Mueller @ 2006-01-05 17:22 UTC (permalink / raw)
  To: Ben Collins; +Cc: linux-kernel

Hi Ben

On Do, 2006-01-05 at 09:17 -0500, Ben Collins wrote: 
> On Thu, 2006-01-05 at 03:34 +0800, Kristian Mueller wrote:
> > We've already found a different solution to this in the Linuxppc-dev
> > list.
> > 
> > See:
> >  http://patchwork.ozlabs.org/linuxppc/patch?id=3737
> 
> That patch makes no sense. It just moves the variable out of the ifdef,
> but if CONFIG_PM or CONFIG_PPC32 is not enabled, then the variable never
> gets modified, and so is always 0. Why not just wrap all the code that
> uses it (like my patch did)?

I had quite the same approach in mind but as Olof Johansson remarked in
http://patchwork.ozlabs.org/linuxppc/patch?id=3736 this would just
introduce more unnecessary #ifdefs.


Regards,
Kristian


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

end of thread, other threads:[~2006-01-06  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-04 22:01 [PATCH 12/15] via-pmu: Wrap some uses of sleep_in_progress with proper ifdef's Ben Collins
2006-01-04 19:34 ` Kristian Mueller
2006-01-05 14:17   ` Ben Collins
2006-01-05 17:22     ` Kristian Mueller

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