2014-12-19 02:01:52

by Fengguang Wu

[permalink] [raw]
Subject: [hisi:integration-hilt-linux-linaro 17/28] drivers/input/touchscreen/atmel_mXT224E.c:460:5: sparse: symbol 'i2c_atmel_read' was not declared. Should it be static?

tree: git://github.com/hisilicon/linux-hisi integration-hilt-linux-linaro
head: 791a2af480ea27735b4669c623b665c5bfea9b5c
commit: d7e9caafdf706341b4165d0a8c2089e60dcebc68 [17/28] Input: enable touch atmel_mXT224E
reproduce:
# apt-get install sparse
git checkout d7e9caafdf706341b4165d0a8c2089e60dcebc68
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/input/touchscreen/atmel_mXT224E.c:460:5: sparse: symbol 'i2c_atmel_read' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:499:28: sparse: Variable length array is used.
>> drivers/input/touchscreen/atmel_mXT224E.c:496:5: sparse: symbol 'i2c_atmel_write' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:532:5: sparse: symbol 'i2c_atmel_write_byte_data' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:538:10: sparse: symbol 'get_object_address' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:547:9: sparse: symbol 'get_object_size' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:557:9: sparse: symbol 'get_object_size_from_address' was not declared. Should it be static?
>> drivers/input/touchscreen/atmel_mXT224E.c:847:32: sparse: symbol 'atmel_ts_get_pdata' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation


2014-12-19 01:57:59

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH hisi] Input: i2c_atmel_read() can be static

drivers/input/touchscreen/atmel_mXT224E.c:460:5: sparse: symbol 'i2c_atmel_read' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:496:5: sparse: symbol 'i2c_atmel_write' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:532:5: sparse: symbol 'i2c_atmel_write_byte_data' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:538:10: sparse: symbol 'get_object_address' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:547:9: sparse: symbol 'get_object_size' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:557:9: sparse: symbol 'get_object_size_from_address' was not declared. Should it be static?
drivers/input/touchscreen/atmel_mXT224E.c:847:32: sparse: symbol 'atmel_ts_get_pdata' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <[email protected]>
---
atmel_mXT224E.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mXT224E.c b/drivers/input/touchscreen/atmel_mXT224E.c
index 0a7fab2..99bcfde 100644
--- a/drivers/input/touchscreen/atmel_mXT224E.c
+++ b/drivers/input/touchscreen/atmel_mXT224E.c
@@ -457,7 +457,7 @@ static struct atmel_ts_data *private_ts;
#define LDO_POWR_VOLTAGE 2700000 /*2.7v*/
static struct regulator *LDO;

-int i2c_atmel_read(struct i2c_client *client, uint16_t address, uint8_t *data, uint8_t length)
+static int i2c_atmel_read(struct i2c_client *client, uint16_t address, uint8_t *data, uint8_t length)
{
int retry, ret;
uint8_t addr[2];
@@ -493,7 +493,7 @@ int i2c_atmel_read(struct i2c_client *client, uint16_t address, uint8_t *data, u
return 0;
}

-int i2c_atmel_write(struct i2c_client *client, uint16_t address, uint8_t *data, uint8_t length)
+static int i2c_atmel_write(struct i2c_client *client, uint16_t address, uint8_t *data, uint8_t length)
{
int retry, loop_i, ret;
uint8_t buf[length + 2];
@@ -529,13 +529,13 @@ int i2c_atmel_write(struct i2c_client *client, uint16_t address, uint8_t *data,

}

-int i2c_atmel_write_byte_data(struct i2c_client *client, uint16_t address, uint8_t value)
+static int i2c_atmel_write_byte_data(struct i2c_client *client, uint16_t address, uint8_t value)
{
i2c_atmel_write(client, address, &value, 1);
return 0;
}

-uint16_t get_object_address(struct atmel_ts_data *ts, uint8_t object_type)
+static uint16_t get_object_address(struct atmel_ts_data *ts, uint8_t object_type)
{
uint8_t loop_i;
for (loop_i = 0; loop_i < ts->id->num_declared_objects; loop_i++) {
@@ -544,7 +544,7 @@ uint16_t get_object_address(struct atmel_ts_data *ts, uint8_t object_type)
}
return 0;
}
-uint8_t get_object_size(struct atmel_ts_data *ts, uint8_t object_type)
+static uint8_t get_object_size(struct atmel_ts_data *ts, uint8_t object_type)
{
uint8_t loop_i;
for (loop_i = 0; loop_i < ts->id->num_declared_objects; loop_i++) {
@@ -554,7 +554,7 @@ uint8_t get_object_size(struct atmel_ts_data *ts, uint8_t object_type)
return 0;
}

-uint8_t get_object_size_from_address(struct atmel_ts_data *ts, int address)
+static uint8_t get_object_size_from_address(struct atmel_ts_data *ts, int address)
{
uint8_t loop_i;
for (loop_i = 0; loop_i < ts->id->num_declared_objects; loop_i++) {
@@ -844,7 +844,7 @@ static int read_object_table(struct atmel_ts_data *ts)
return 0;
}

-struct atmel_i2c_platform_data *atmel_ts_get_pdata(struct i2c_client *client)
+static struct atmel_i2c_platform_data *atmel_ts_get_pdata(struct i2c_client *client)
{
struct device_node *node = client->dev.of_node;
struct atmel_i2c_platform_data *pdata = client->dev.platform_data;

2014-12-21 11:30:11

by zhangfei

[permalink] [raw]
Subject: Re: [PATCH hisi] Input: i2c_atmel_read() can be static



On 12/19/2014 09:56 AM, kbuild test robot wrote:
> drivers/input/touchscreen/atmel_mXT224E.c:460:5: sparse: symbol 'i2c_atmel_read' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:496:5: sparse: symbol 'i2c_atmel_write' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:532:5: sparse: symbol 'i2c_atmel_write_byte_data' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:538:10: sparse: symbol 'get_object_address' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:547:9: sparse: symbol 'get_object_size' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:557:9: sparse: symbol 'get_object_size_from_address' was not declared. Should it be static?
> drivers/input/touchscreen/atmel_mXT224E.c:847:32: sparse: symbol 'atmel_ts_get_pdata' was not declared. Should it be static?
>
> Signed-off-by: Fengguang Wu <[email protected]>

Thanks Fengguang for the patch, will take it.

However, the file drivers/input/touchscreen/atmel_mXT224E.c is not used
for mainline kernel.

Xuwei will remove git://github.com/hisilicon/linux-hisi
integration-hilt-linux-linaro.
Sorry for the confusion.

Thanks