From 2114772e3878b9bf6f26a7889a5e94bf348a53df Mon Sep 17 00:00:00 2001 From: liujg6 Date: Fri, 21 Aug 2020 16:46:55 +0800 Subject: [PATCH] ili9882_mmi: fix build breakage on R Fix below forbidden warnings: motorola/kernel/modules/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c:443:4: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] motorola/kernel/modules/drivers/input/touchscreen/ili9882_mmi/ili9882.c:569:6: warning: comparison of array 'cmd' equal to a null pointer is always false [-Wtautological-pointer-compare] motorola/kernel/modules/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c:201:12: warning: comparison of array 'file->fname' equal to a null pointer is always false [-Wtautological-pointer-compare] motorola/kernel/modules/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c:2056:15: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare] Change-Id: I46b24a8078b9e7e28c5fbfa6a7d32731368c96a1 Reviewed-on: https://gerrit.mot.com/1740710 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wang Wang Submit-Approved: Jira Key --- .../touchscreen/chipone_tddi_mmi/cts_sysfs.c | 2 +- .../input/touchscreen/ili9882_mmi/ili9882.c | 4 +-- .../touchscreen/ili9882_mmi/ili9882_node.c | 4 +-- .../touchscreen/ili9882_mmi/ili9882_qcom.c | 32 ++++++++++--------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c b/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c index 8e25260d3d44..af863f9f8edc 100755 --- a/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c +++ b/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c @@ -2053,7 +2053,7 @@ static ssize_t jitter_store(struct device *dev, ret = kstrtou16(argv[0], 0, &cnt); if (ret == 0) { - if (cnt > 2 || cnt < 10000) { + if (cnt < 2 || cnt > 10000) { jitter_test_frame = cnt; } } diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882.c b/drivers/input/touchscreen/ili9882_mmi/ili9882.c index a1d49ffa2b52..1b096b20fb8d 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882.c @@ -566,10 +566,10 @@ int ili_set_tp_data_len(int format, bool send, u8* data) ctrl = DATA_FORMAT_DEBUG_LITE_CMD; break; case DATA_FORMAT_DEBUG_LITE_AREA: - if(cmd == NULL) { + /*if(cmd == NULL) { ILI_ERR("DATA_FORMAT_DEBUG_LITE_AREA error cmd\n"); return -1; - } + }*/ debug_ctrl = DATA_FORMAT_DEBUG_LITE_AREA_CMD; ctrl = DATA_FORMAT_DEBUG_LITE_CMD; cmd[3] = data[0]; diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c index 6ebd462070a5..7bacc0466550 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c @@ -198,10 +198,10 @@ static int file_write(struct file_buffer *file, bool new_open) return -1; } - if (file->fname == NULL) { + /*if (file->fname == NULL) { ILI_ERR("file name is invaild\n"); return -1; - } + }*/ if (file->flen >= file->max_size) { ILI_ERR("The length saved to file is too long !\n"); diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c index 3ead29248b5b..658a4d632492 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c @@ -426,8 +426,8 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev blank = evdata->data; - switch (*blank) { - case DRM_PANEL_BLANK_POWERDOWN: + switch (*blank) { + case DRM_PANEL_BLANK_POWERDOWN: /* if (TP_SUSPEND_PRIO) { if (event != MSM_DRM_EARLY_EVENT_BLANK) @@ -438,22 +438,24 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev } */ if (event == DRM_PANEL_EARLY_EVENT_BLANK) + { if (ili_sleep_handler(TP_SUSPEND) < 0) ILI_ERR("TP suspend failed\n"); - break; - - case DRM_PANEL_BLANK_UNBLANK: - if (event == DRM_PANEL_EVENT_BLANK) - { - if (ili_sleep_handler(TP_RESUME) < 0) - ILI_ERR("TP resume failed\n"); - - } - break; - default: - ILI_ERR("Unknown event, blank = %d\n", *blank); - break; } + break; + + case DRM_PANEL_BLANK_UNBLANK: + if (event == DRM_PANEL_EVENT_BLANK) + { + if (ili_sleep_handler(TP_RESUME) < 0) + ILI_ERR("TP resume failed\n"); + + } + break; + default: + ILI_ERR("Unknown event, blank = %d\n", *blank); + break; + } return NOTIFY_OK; } #else