[pkg-fso-commits] [SCM] linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko branch, andy-tracking, updated. upstream/20090303.gitb9de904e-140-g23b564c

Andy Green agreen at octopus.localdomain
Mon Jun 8 17:29:38 UTC 2009


The following commit has been merged in the andy-tracking branch:
commit 25db5513242fb8d9fac0f461e110cc82d6b3f90f
Author: Nelson Castillo <arhuaco at freaks-unidos.net>
Date:   Tue Mar 10 12:04:26 2009 +0000

    Export symbols and make a few symbols constant.
    
    ~ Make a few symbols constant.
    ~ Export symbols explicitly.
    ~ Move ts_filter.c to ts_filter_chain.c (this will make sense later).
    
    Signed-off-by: Nelson Castillo <arhuaco at freaks-unidos.net>

diff --git a/arch/arm/mach-s3c2410/include/mach/ts.h b/arch/arm/mach-s3c2410/include/mach/ts.h
index 0600b30..41ac64c 100644
--- a/arch/arm/mach-s3c2410/include/mach/ts.h
+++ b/arch/arm/mach-s3c2410/include/mach/ts.h
@@ -27,9 +27,9 @@ struct s3c2410_ts_mach_info {
 	 * Null-terminated array of pointers to filter APIs and configurations
 	 * we want to use. In the same order they will be applied.
 	 */
-	struct ts_filter_configuration *filter_config;
+	const struct ts_filter_configuration *filter_config;
 };
 
-void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info);
+void set_s3c2410ts_info(const struct s3c2410_ts_mach_info *hard_s3c2410ts_info);
 
 #endif /* __ASM_ARM_TS_H */
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 49cf09e..fa55aba 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -952,32 +952,32 @@ static struct s3c2410_udc_mach_info gta02_udc_cfg = {
 /* Touchscreen configuration. */
 
 #ifdef CONFIG_TOUCHSCREEN_FILTER
-static struct ts_filter_group_configuration gta02_ts_group = {
+const static struct ts_filter_group_configuration gta02_ts_group = {
 	.length = 12,
 	.close_enough = 10,
 	.threshold = 6,		/* At least half of the points in a group. */
 	.attempts = 10,
 };
 
-static struct ts_filter_median_configuration gta02_ts_median = {
+const static struct ts_filter_median_configuration gta02_ts_median = {
 	.extent = 20,
 	.decimation_below = 3,
 	.decimation_threshold = 8 * 3,
 	.decimation_above = 4,
 };
 
-static struct ts_filter_mean_configuration gta02_ts_mean = {
+const static struct ts_filter_mean_configuration gta02_ts_mean = {
 	.length = 4,
 };
 
-static struct ts_filter_linear_configuration gta02_ts_linear = {
+const static struct ts_filter_linear_configuration gta02_ts_linear = {
 	.constants = {1, 0, 0, 0, 1, 0, 1},	/* Don't modify coords. */
 	.coord0 = 0,
 	.coord1 = 1,
 };
 #endif
 
-struct ts_filter_configuration filter_configuration[] =
+const struct ts_filter_configuration filter_configuration[] =
 {
 #ifdef CONFIG_TOUCHSCREEN_FILTER
 	{&ts_filter_group_api,		&gta02_ts_group.config},
@@ -988,7 +988,7 @@ struct ts_filter_configuration filter_configuration[] =
 	{NULL, NULL},
 };
 
-static struct s3c2410_ts_mach_info gta02_ts_cfg = {
+const static struct s3c2410_ts_mach_info gta02_ts_cfg = {
 	.delay = 10000,
 	.presc = 0xff, /* slow as we can go */
 	.filter_config = filter_configuration,
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index fbba93d..0fdaa54 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -211,9 +211,10 @@ EXPORT_SYMBOL(s3c_device_ts);
 
 static struct s3c2410_ts_mach_info s3c2410ts_info;
 
-void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
+void set_s3c2410ts_info(const struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
 {
-	memcpy(&s3c2410ts_info,hard_s3c2410ts_info,sizeof(struct s3c2410_ts_mach_info));
+	memcpy(&s3c2410ts_info, hard_s3c2410ts_info,
+	       sizeof(struct s3c2410_ts_mach_info));
 	s3c_device_ts.dev.platform_data = &s3c2410ts_info;
 }
 EXPORT_SYMBOL(set_s3c2410ts_info);
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 2669d63..940570b 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -35,7 +35,7 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712)	+= wm9712.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713)	+= wm9713.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)	+= mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_S3C2410)	+= s3c2410_ts.o
-obj-$(CONFIG_TOUCHSCREEN_FILTER)	+= ts_filter.o
+obj-$(CONFIG_TOUCHSCREEN_FILTER)	+= ts_filter_chain.o
 obj-$(CONFIG_TOUCHSCREEN_FILTER_GROUP)	+= ts_filter_group.o
 obj-$(CONFIG_TOUCHSCREEN_FILTER_LINEAR)	+= ts_filter_linear.o
 obj-$(CONFIG_TOUCHSCREEN_FILTER_MEDIAN)	+= ts_filter_median.o
diff --git a/drivers/input/touchscreen/ts_filter.h b/drivers/input/touchscreen/ts_filter.h
index 630ea51..0e4704f 100644
--- a/drivers/input/touchscreen/ts_filter.h
+++ b/drivers/input/touchscreen/ts_filter.h
@@ -18,9 +18,10 @@ struct ts_filter_configuration;
 
 struct ts_filter_api {
 	/* Create the filter - mandatory. */
-	struct ts_filter * (*create)(struct platform_device *pdev,
-				     struct ts_filter_configuration *config,
-				     int count_coords);
+	struct ts_filter * (*create)(
+		struct platform_device *pdev,
+		const struct ts_filter_configuration *config,
+		int count_coords);
 	/* Destroy the filter - mandatory. */
 	void (*destroy)(struct ts_filter *filter);
 	/* Clear the filter - optional. */
@@ -62,14 +63,14 @@ struct ts_filter_api {
  */
 struct ts_filter_configuration {
 	/* API to use */
-	struct ts_filter_api *api;
+	const struct ts_filter_api *api;
 	/* Generic filter configuration. Different for each filter. */
-	struct ts_filter_configuration *config;
+	const struct ts_filter_configuration *config;
 };
 
 struct ts_filter {
 	/* Operations for this filter. */
-	struct ts_filter_api *api;
+	const struct ts_filter_api *api;
 	/* Number of coordinates to process. */
 	int count_coords;
 };
@@ -82,7 +83,7 @@ struct ts_filter {
  */
 extern struct ts_filter **ts_filter_chain_create(
 	struct platform_device *pdev,
-	struct ts_filter_configuration conf[],
+	const struct ts_filter_configuration conf[],
 	int count_coords);
 
 /* Helper to destroy a whole chain from the list of filter pointers. */
diff --git a/drivers/input/touchscreen/ts_filter.c b/drivers/input/touchscreen/ts_filter_chain.c
similarity index 93%
rename from drivers/input/touchscreen/ts_filter.c
rename to drivers/input/touchscreen/ts_filter_chain.c
index 5551fe3..9b2b1c5 100644
--- a/drivers/input/touchscreen/ts_filter.c
+++ b/drivers/input/touchscreen/ts_filter_chain.c
@@ -29,9 +29,10 @@
  * sptrlen - Count how many non-null pointers are in a pointer array
  * @arr: The array of pointers
  */
-static int sptrlen(void *arr)
+static int sptrlen(const void *arr)
 {
-	int **p = arr; /* all pointers have the same size */
+	/* All pointers have the same size. */
+	const int **p = (const int **)arr;
 	int len = 0;
 
 	while (*(p++))
@@ -43,9 +44,10 @@ static int sptrlen(void *arr)
 /* FIXME: rename & remove this temporal hack. */
 static struct ts_filter **revchain;
 
-struct ts_filter **ts_filter_chain_create(struct platform_device *pdev,
-					  struct ts_filter_configuration conf[],
-					  int count_coords)
+struct ts_filter **ts_filter_chain_create(
+	struct platform_device *pdev,
+	const struct ts_filter_configuration conf[],
+	int count_coords)
 {
 	struct ts_filter **arr;
 	int count = 0;
diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c
index ac3229f..18236e2 100644
--- a/drivers/input/touchscreen/ts_filter_group.c
+++ b/drivers/input/touchscreen/ts_filter_group.c
@@ -85,7 +85,7 @@ static void ts_filter_group_clear(struct ts_filter *tsf)
 
 static struct ts_filter *ts_filter_group_create(
 	struct platform_device *pdev,
-	struct ts_filter_configuration *conf,
+	const struct ts_filter_configuration *conf,
 	int count_coords)
 {
 	struct ts_filter_group *tsfg;
@@ -283,7 +283,7 @@ static void ts_filter_group_scale(struct ts_filter *tsf, int *coords)
 	ts_filter_group_clear_internal(priv, priv->config->attempts);
 }
 
-struct ts_filter_api ts_filter_group_api = {
+const struct ts_filter_api ts_filter_group_api = {
 	.create =	ts_filter_group_create,
 	.destroy =	ts_filter_group_destroy,
 	.clear =	ts_filter_group_clear,
@@ -292,4 +292,5 @@ struct ts_filter_api ts_filter_group_api = {
 	.getpoint =	ts_filter_group_getpoint,
 	.scale =	ts_filter_group_scale,
 };
+EXPORT_SYMBOL_GPL(ts_filter_group_api);
 
diff --git a/drivers/input/touchscreen/ts_filter_group.h b/drivers/input/touchscreen/ts_filter_group.h
index 4fc2af7..c7d094d 100644
--- a/drivers/input/touchscreen/ts_filter_group.h
+++ b/drivers/input/touchscreen/ts_filter_group.h
@@ -31,6 +31,6 @@ struct ts_filter_group_configuration {
 	struct ts_filter_configuration config;
 };
 
-extern struct ts_filter_api ts_filter_group_api;
+extern const struct ts_filter_api ts_filter_group_api;
 
 #endif
diff --git a/drivers/input/touchscreen/ts_filter_linear.c b/drivers/input/touchscreen/ts_filter_linear.c
index bb63814..8a10495 100644
--- a/drivers/input/touchscreen/ts_filter_linear.c
+++ b/drivers/input/touchscreen/ts_filter_linear.c
@@ -127,7 +127,7 @@ static ssize_t const_store(struct const_obj *obj, struct const_attribute *attr,
 
 static struct ts_filter *ts_filter_linear_create(
 	struct platform_device *pdev,
-	struct ts_filter_configuration *conf,
+	const struct ts_filter_configuration *conf,
 	int count_coords)
 {
 	struct ts_filter_linear *tsfl;
@@ -194,8 +194,10 @@ static void ts_filter_linear_scale(struct ts_filter *tsf, int *coords)
 	coords[tsfl->config->coord1] = (k[5] + k[3] * c0 + k[4] * c1) / k[6];
 }
 
-struct ts_filter_api ts_filter_linear_api = {
+const struct ts_filter_api ts_filter_linear_api = {
 	.create =	ts_filter_linear_create,
 	.destroy =	ts_filter_linear_destroy,
 	.scale =	ts_filter_linear_scale,
 };
+EXPORT_SYMBOL_GPL(ts_filter_linear_api);
+
diff --git a/drivers/input/touchscreen/ts_filter_linear.h b/drivers/input/touchscreen/ts_filter_linear.h
index 5cd9a81..67f6f94 100644
--- a/drivers/input/touchscreen/ts_filter_linear.h
+++ b/drivers/input/touchscreen/ts_filter_linear.h
@@ -26,6 +26,6 @@ struct ts_filter_linear_configuration {
 	struct ts_filter_configuration config;
 };
 
-extern struct ts_filter_api ts_filter_linear_api;
+extern const struct ts_filter_api ts_filter_linear_api;
 
 #endif
diff --git a/drivers/input/touchscreen/ts_filter_mean.c b/drivers/input/touchscreen/ts_filter_mean.c
index 291226e..a3c5f08 100644
--- a/drivers/input/touchscreen/ts_filter_mean.c
+++ b/drivers/input/touchscreen/ts_filter_mean.c
@@ -52,7 +52,7 @@ static void ts_filter_mean_clear(struct ts_filter *tsf);
 
 static struct ts_filter *ts_filter_mean_create(
 	struct platform_device *pdev,
-	struct ts_filter_configuration *conf,
+	const struct ts_filter_configuration *conf,
 	int count_coords)
 {
 	struct ts_filter_mean *priv;
@@ -161,7 +161,7 @@ static void ts_filter_mean_scale(struct ts_filter *tsf, int *coords)
 	}
 }
 
-struct ts_filter_api ts_filter_mean_api = {
+const struct ts_filter_api ts_filter_mean_api = {
 	.create =	ts_filter_mean_create,
 	.destroy =	ts_filter_mean_destroy,
 	.clear =	ts_filter_mean_clear,
@@ -170,4 +170,5 @@ struct ts_filter_api ts_filter_mean_api = {
 	.haspoint =	ts_filter_mean_haspoint,
 	.getpoint =	ts_filter_mean_getpoint,
 };
+EXPORT_SYMBOL_GPL(ts_filter_mean_api);
 
diff --git a/drivers/input/touchscreen/ts_filter_mean.h b/drivers/input/touchscreen/ts_filter_mean.h
index 7b3935f..f5b5e4b 100644
--- a/drivers/input/touchscreen/ts_filter_mean.h
+++ b/drivers/input/touchscreen/ts_filter_mean.h
@@ -23,6 +23,6 @@ struct ts_filter_mean_configuration {
 };
 
 /* API functions for the mean filter */
-extern struct ts_filter_api ts_filter_mean_api;
+extern const struct ts_filter_api ts_filter_mean_api;
 
 #endif /* __TS_FILTER_MEAN_H__ */
diff --git a/drivers/input/touchscreen/ts_filter_median.c b/drivers/input/touchscreen/ts_filter_median.c
index 547ca8d..b8a6206 100644
--- a/drivers/input/touchscreen/ts_filter_median.c
+++ b/drivers/input/touchscreen/ts_filter_median.c
@@ -105,7 +105,7 @@ static void ts_filter_median_clear(struct ts_filter *tsf)
 
 static struct ts_filter *ts_filter_median_create(
 	struct platform_device *pdev,
-	struct ts_filter_configuration *conf,
+	const struct ts_filter_configuration *conf,
 	int count_coords)
 {
 	int *p;
@@ -248,7 +248,7 @@ static void ts_filter_median_getpoint(struct ts_filter *tsf, int *point)
 	priv->ready = 0;
 }
 
-struct ts_filter_api ts_filter_median_api = {
+const struct ts_filter_api ts_filter_median_api = {
 	.create =	ts_filter_median_create,
 	.destroy =	ts_filter_median_destroy,
 	.clear =	ts_filter_median_clear,
@@ -257,3 +257,5 @@ struct ts_filter_api ts_filter_median_api = {
 	.haspoint =	ts_filter_median_haspoint,
 	.getpoint =	ts_filter_median_getpoint,
 };
+EXPORT_SYMBOL_GPL(ts_filter_median_api);
+
diff --git a/drivers/input/touchscreen/ts_filter_median.h b/drivers/input/touchscreen/ts_filter_median.h
index 17a1ca6..1c19472 100644
--- a/drivers/input/touchscreen/ts_filter_median.h
+++ b/drivers/input/touchscreen/ts_filter_median.h
@@ -27,6 +27,6 @@ struct ts_filter_median_configuration {
 	struct ts_filter_configuration config;
 };
 
-extern struct ts_filter_api ts_filter_median_api;
+extern const struct ts_filter_api ts_filter_median_api;
 
 #endif

-- 
linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko



More information about the pkg-fso-commits mailing list