Thread (13 messages) 13 messages, 2 authors, 2009-01-16

Re: [PATCH 3/5] Add median filter

flat view

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2009-01-15 23:49:05
Also in: lkml

On Tue, 13 Jan 2009 18:39:55 -0500
Nelson [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+static void ts_filter_median_del(int *p, int value, int count)
+{
+	int index;
+
+	for (index = 0; index < count; index++)
+		if (p[index] == value) {
+			for (; index < count; index++)
+				p[index] = p[index + 1];
+			return;
+		}
+}
+
+
+static void ts_filter_median_clear_internal(struct ts_filter *tsf)
+{
+	struct ts_filter_median *tsfm = (struct ts_filter_median *)tsf;
+
+	tsfm->pos = 0;
+	tsfm->valid = 0;
+
+}
+static void ts_filter_median_clear(struct ts_filter *tsf)
+{
+	ts_filter_median_clear_internal(tsf);
+
+	if (tsf->next) /* chain */
+		(tsf->next->api->clear)(tsf->next);
+}
Again, the code seems to do an awful lot of browsing over
exernally-visible data structures while holding no locks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help