[PATCH 09/10] fix-pcf50633-migrate-gta02-peripherals-out.patch

Werner Almesberger werner at openmoko.org
Thu Jun 19 03:31:54 CEST 2008


Andy Green wrote:
> pcf50633.c shouldn't know GTAxx at all.

Yeah, glad to see that mess go ! ;-)

One nitpick:

> +int pcf50633_wait_for_ready(struct pcf50633_data *pcf, int timeout_ms,
> +								char *name)
> +{
> +	/* so we always go once */
> +	timeout_ms += 5;
> +
> +	while ((timeout_ms >= 5) && (pcf50633_ready(pcf))) {
> +		timeout_ms -= 5; /* well, it isn't very accurate, but OK */
> +		msleep(5);
> +	}
> +
> +	if (timeout_ms < 5) {

That seems a bit contorted. Why not just make the whole thing
zero-based ? BTW, not even Pascal makes you put parentheses around
functions returning a boolean ;-)

- Werner




More information about the openmoko-kernel mailing list