login
Header Space

 
 

Re: linux-next20080314 build fails with !CONFIG_PM

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kamalesh Babulal <kamalesh@...>
Cc: <linux-next@...>, <sfr@...>, <linux-kernel@...>, <apw@...>, Alan Stern <stern@...>, Len Brown <lenb@...>
Date: Friday, March 14, 2008 - 6:05 pm

On Fri, 14 Mar 2008 13:27:10 +0530
Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> wrote:


Caused by Alan's "PM: make wakeup flags available whenever CONFIG_PM is
set" which I assume Len merged.


Sorry, but that code should be dragged out and shot.  Doing this:


is just gross and stupid.  It looks daft, it isn't C and it *requires* that
device_can_wakeup() be implemented as a macro, which totally busts any
concept of abstraction.


The code previously had quite reasonable accessors:

 #define device_set_wakeup_enable(dev,val) \
        ((dev)->power.should_wakeup = !!(val))
 #define device_may_wakeup(dev) \
        (device_can_wakeup(dev) && (dev)->power.should_wakeup)

can we please go back to that scheme?  Please also convert all these
magical macros into inlined C functions.  One reason is that this:

+#define device_init_wakeup(dev,val) \
+       do { \
+               device_can_wakeup(dev) = !!(val); \
+               device_set_wakeup_enable(dev,val); \
+       } while(0)

is buggy.  It evaluates its arguments multiple times and will cause
failures when passed expressions which have side-effects.

Alan, please also pass all future patches through checkpatch - there is no
need to be adding trivial coding-style errors in this day and age.

Thanks.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
linux-next20080314 build fails with !CONFIG_PM , Kamalesh Babulal, (Fri Mar 14, 3:57 am)
Re: linux-next20080314 build fails with !CONFIG_PM, Andrew Morton, (Fri Mar 14, 6:05 pm)
Re: linux-next20080314 build fails with !CONFIG_PM, Rafael J. Wysocki, (Fri Mar 14, 6:37 pm)
[PATCH 0/3] PM wakeup flags revisited, Alan Stern, (Sat Mar 15, 5:53 pm)
speck-geostationary