Re: [PATCH 3/5] Add median filter

From: Andrew Morton
Date: Thu Jan 15 2009 - 18:49:06 EST


On Tue, 13 Jan 2009 18:39:55 -0500
Nelson <arhuaco@xxxxxxxxxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/