lkml.org 
[lkml]   [2009]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] Add median filter
On Tue, 13 Jan 2009 18:39:55 -0500
Nelson <arhuaco@freaks-unidos.net> wrote:

> +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.



\
 
 \ /
  Last update: 2009-01-16 00:51    [W:0.086 / U:2.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site