Messages in this thread | | | Date | Thu, 15 Jan 2009 15:47:24 -0800 | From | Andrew Morton <> | Subject | Re: [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.
| |