lkml.org 
[lkml]   [2007]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 5/5] Blackfin: on-chip RTC controller driver
On Thu, Mar 01, 2007 at 12:15:46PM +0800, Wu, Bryan wrote:
> +#define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __FUNCTION__, __LINE__, ## args)
> +#define stampit() stamp("here i am")
> +

Are these really necessary for the final driver? It's littered all over
the place, and presumably the driver should be functional enough to not
need this sort of debugging instrumentation.

[snip]

> +static void rtc_bfin_sync_pending(void)
> +{
> + stampit();
> + while (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_COMPLETE)) {
> + if (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING))
> + break;
> + }
> + bfin_write_RTC_ISTAT(RTC_ISTAT_WRITE_COMPLETE);
> +}
> +
No timeout? (and superfluous braces)

> + case RTC_PIE_ON:
> + stampit();
> + spin_lock_irq(&rtc->lock);
> + rtc_bfin_sync_pending();

And it's also called under a spinlock each time.. this is a disaster
waiting to happen.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-01 10:19    [W:0.444 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site