PATCH: suspend and poweroff (#3603 candidate)

Bernardo Innocenti bernie at codewiz.org
Fri Sep 21 00:52:47 EDT 2007


Jordan Crouse wrote:

> Two comments inline - this looks good to me, but i'll need to apply it
> to see whats up with GX.   Next step is to toss it into the playground,
> I guess to get some miles on it before Andres pulls it in.

Normally I'd do that, especially for such an invasive patch.
But everybody would want this fixed for yesterday :-)


>> @@ -1474,10 +1468,10 @@ void fb_set_suspend(struct fb_info *info, int state)
>>  	struct fb_event event;
>>  
>>  	event.info = info;
>> -	if (state) {
>> +	if (state && info->state != FBINFO_STATE_SUSPENDED) {
>>  		fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
>>  		info->state = FBINFO_STATE_SUSPENDED;
>> -	} else {
>> +	} else if (info->state != FBINFO_STATE_RUNNING) {
>>  		info->state = FBINFO_STATE_RUNNING;
>>  		fb_notifier_call_chain(FB_EVENT_RESUME, &event);
>>  	}
> 
> 
> What is this for?  fb_set_suspend() is a pre-existing API function - we want
> to make sure we don't break the intended functionality.

I pushed those checks here in an attempt to simplify the caller.
Now I see it wasn't very bright, so I reworked the code not to do it.


>>  #define MIN_NR_CONSOLES 1       /* must be at least 1 */
>> -#define MAX_NR_CONSOLES	63	/* serial lines start at 64 */
>> -#define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
>> +#define MAX_NR_CONSOLES	15	/* serial lines start at 64 */
>> +#define MAX_NR_USER_CONSOLES 15	/* must be root to allocate above this */
>>  		/* Note: the ioctl VT_GETSTATE does not work for
>>  		   consoles 16 and higher (since it returns a short) */
>>  
> 
> Ugh! What is this?  I don't think you meant this to be in here.. :)

Yeah, a leftover from an old patch to see if I could save some memory
and boot time by reducing the number of virtual consoles.

-- 
 \__/
 |__|  Bernardo Innocenti - http://www.codewiz.org/
  \__\ One Laptop Per Child - http://www.laptop.org/



More information about the Devel mailing list