On Monday, 25 June 2007 02:10, David Brownell wrote: > On Saturday 23 June 2007, Rafael J. Wysocki wrote: > > On Saturday, 23 June 2007 03:32, Alan Stern wrote: > > > > A good way to identify a sleep state would be a pointer to a string > > > containing the state's name. The PM core could use these pointers to > > > export the states in sysfs. > > > > Well, I thought of exactly the same thing. > > There's an echo in the room ... > > > > Perhaps we can generalize it a bit by defining: > > > > struct pm_sleep_state { > > char *name; > > }; > > I suppose having the core use only the name would be a bit radical; > but on the other hand, I really like the resulting notion that the > generic code must accordingly know *NOTHING* about the semantics > of any such states. Having a struct sort of begs that it someday > be expanded. Still, so to speak, the struct is self-commenting (to some extent), and the 'bare' string might be confusing in some contexts. > > and make the platforms give us a NULL-terminated array of such things during > > the initializatiion. > > And conceptually "typedef struct pm_sleep_state *suspend_state_t;"? More or less. > Though eventually "suspend_state_t" should vanish. Well ... Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm