From c41f3de88c6a25a118859e0a666ec15fa7f16b51 Mon Sep 17 00:00:00 2001 From: Stricted Date: Tue, 24 Dec 2019 07:50:27 +0000 Subject: [PATCH] fix clang building for greatlte --- drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c | 6 +++--- drivers/staging/sti/abc/abc_common.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c b/drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c index 03b2fa16d851..b8ce7c0762b9 100644 --- a/drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c +++ b/drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c @@ -605,7 +605,7 @@ static ssize_t read_pressure_raw_check_show(struct device *dev, char tmp[20] = {0}; snprintf(tmp, sizeof(tmp), "\"TP%02d%c\":\"%d\"", data[i], loc[j], ts->pressure_data[data[i]][j]); - strncat(buff, tmp, sizeof(tmp)); + strlcat(buff, tmp, sizeof(buff)); if (i < 3 || j < PRESSURE_CHANNEL_NUM - 1) strncat(buff, ",", 2); } @@ -705,7 +705,7 @@ static ssize_t get_lp_dump(struct device *dev, struct device_attribute *attr, ch snprintf(buff, sizeof(buff), "%d: %04x%04x%04x%04x\n", string_addr, data0, data1, data2, data3); - strncat(buf, buff, sizeof(buff)); + strlcat(buf, buff, sizeof(buf)); } } @@ -3261,7 +3261,7 @@ static void clear_cover_mode(void *device_data) #endif } - if (!ts->power_status == SEC_TS_STATE_POWER_OFF && ts->reinit_done) { + if (!(ts->power_status == SEC_TS_STATE_POWER_OFF) && ts->reinit_done) { if (ts->flip_enable) sec_ts_set_cover_type(ts, true); else diff --git a/drivers/staging/sti/abc/abc_common.c b/drivers/staging/sti/abc/abc_common.c index 813a6e379454..d93f5524fd7e 100644 --- a/drivers/staging/sti/abc/abc_common.c +++ b/drivers/staging/sti/abc/abc_common.c @@ -353,7 +353,7 @@ static void sec_abc_work_func(struct work_struct *work) } sprintf(timestamp, "TIMESTAMP=%lu", ktime_ms); uevent_str[idx++] = ×tamp[0]; - uevent_str[idx] = '\0'; + uevent_str[idx] = (char *)'\0'; strlcpy(event_type, uevent_str[1] + 6, sizeof(event_type)); ABC_PRINT("event type : %s\n", event_type); -- 2.20.1