fix clang building for greatlte
authorStricted <info@stricted.net>
Tue, 24 Dec 2019 07:50:27 +0000 (07:50 +0000)
committerivanmeler <i_ivan@windowslive.com>
Wed, 13 Apr 2022 21:14:01 +0000 (21:14 +0000)
drivers/input/touchscreen/sec_ts_y661/sec_ts_fn.c
drivers/staging/sti/abc/abc_common.c

index 03b2fa16d851222e79c600e4422522e4821484cc..b8ce7c0762b9278d0787358802a868bb8d2d66e4 100644 (file)
@@ -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
index 813a6e379454a4f8868cc276ab4e23d18eaece35..d93f5524fd7e5207699d0a262648b1187a1e713a 100644 (file)
@@ -353,7 +353,7 @@ static void sec_abc_work_func(struct work_struct *work)
        }
        sprintf(timestamp, "TIMESTAMP=%lu", ktime_ms);
        uevent_str[idx++] = &timestamp[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);