aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ts_filter_median.c
diff options
context:
space:
mode:
authormerge <null@invalid>2008-12-04 21:30:41 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-04 21:30:41 +0000
commit1bfcb6881cb4ea120894ef4e032fa3ca7d311b35 (patch)
treef1baa757ac1c48529a2433a295a490ef383c82b5 /drivers/input/touchscreen/ts_filter_median.c
parentf1e6e9204ab03f140abe71c701d79728ae9a0baf (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-cleanup-add-internal-functions-1228426177
pending-tracking-hist top was MERGE-via-stable-tracking-cleanup-add-internal-functions-1228426177 / cf9f1f4a754f2db71f829a8b07ac455e053b3d1f ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-cleanup-add-internal-functions stable-tracking-hist top was cleanup-add-internal-functions / 251b632aa7be6c6307a6938a59793e205da5b326 ... parent commitmessage: From: Nelson Castillo <nelsoneci@gmail.com> Cleanup - Add internal functions for clearing filters This patch adds the following functions: * ts_filter_mean_clear_internal * ts_filter_median_clear_internal The idea: avoid calling the clean function of other filters when we initialize one. Also: * modify messages for consistency. * remove an unneeded else. Signed-off-by: Nelson Castillo <nelsoneci@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ts_filter_median.c')
-rw-r--r--drivers/input/touchscreen/ts_filter_median.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/ts_filter_median.c b/drivers/input/touchscreen/ts_filter_median.c
index d60c4314b87..67dd3febd55 100644
--- a/drivers/input/touchscreen/ts_filter_median.c
+++ b/drivers/input/touchscreen/ts_filter_median.c
@@ -65,13 +65,18 @@ static void ts_filter_median_del(int *p, int value, int count)
}
-static void ts_filter_median_clear(struct ts_filter *tsf)
+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);
}
@@ -92,10 +97,6 @@ static struct ts_filter *ts_filter_median_create(void * conf, int count_coords)
tsfm->config->midpoint = (tsfm->config->extent >> 1) + 1;
- printk(KERN_INFO" Creating Median ts filter len %d depth %d dec %d\n",
- tsfm->config->extent, count_coords,
- tsfm->config->decimation_threshold);
-
p = kmalloc(2 * count_coords * sizeof(int) * (tsfm->config->extent + 1),
GFP_KERNEL);
if (!p) {
@@ -110,7 +111,11 @@ static struct ts_filter *ts_filter_median_create(void * conf, int count_coords)
p += tsfm->config->extent + 1;
}
- ts_filter_median_clear(&tsfm->tsf);
+ ts_filter_median_clear_internal(&tsfm->tsf);
+
+ printk(KERN_INFO" Created Median ts filter len %d depth %d dec %d\n",
+ tsfm->config->extent, count_coords,
+ tsfm->config->decimation_threshold);
return &tsfm->tsf;
}
@@ -195,8 +200,8 @@ static int ts_filter_median_process(struct ts_filter *tsf, int *coords)
if (tsf->next) /* chain */
return (tsf->next->api->process)(tsf->next, coords);
- else
- return 1;
+
+ return 1;
}
struct ts_filter_api ts_filter_median_api = {