Re: [Patch] Fix the possibility of insane return value of hpet_calibrate() against SMI. (take 2)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Monday, March 30, 2009 - 2:06 pm

On Wed, 18 Mar 2009 11:47:04 +0900
Yasunori Goto <y-goto@jp.fujitsu.com> wrote:


Call me paranoid, but I'd like to see a maximum retry count here and an
error message-and-continue if it is exceeded.  To prevent mysterious
boot-time lockups from misbehaving hpets, perhaps?

Also, style nit - I find

	for ( ; ; ) {
		...
	}

to be more readable than

	do {
		...
	} while (1);

and I believe the former is more common.


And

	unsigned long ret = -1;

has the same effect as

	unsigned long ret = ~0UL;

but is more maintainable - it doesn't subtly break if someone changes
the type of `ret'.  (This is a bit of an ugly C trick).



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

Messages in current thread:
Re: [Patch] Fix the possibility of insane return value of ..., Clemens Ladisch, (Wed Mar 18, 12:44 am)
Re: [Patch] Fix the possibility of insane return value of ..., Andrew Morton, (Mon Mar 30, 2:06 pm)