From e53ef340985bda96d21f4d7c712b592f0d7a743f Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Fri, 31 Jul 2020 11:27:16 +0800 Subject: [PATCH] DLKM: himax_v2_mmi: fix compile error himax_v2_mmi: Fix compile error when change AndroidKernelModule.mk. (https://gerrit.mot.com/#/c/1706097/) Following warnings as errors: [-Wunused-const-variable] [-Wpointer-bool-conversion] [-Wformat-security] NO_PROP_NEEDED: Change-Id: I051335ac9fc4dcaa8ae3ea7f6f51965bd794ee5c Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/1709606 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Zhenxin Xi Reviewed-by: Jun Weng Submit-Approved: Jira Key --- drivers/input/touchscreen/himax_v2_mmi/himax_common.c | 4 ++-- drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c | 4 ++-- .../input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c index 3d4fd4d255d6..66573c698c96 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c @@ -3398,7 +3398,7 @@ static int himax_sysfs_touchscreen( ts_class_dev = device_create(touchscreen_class, NULL, MKDEV(INPUT_MAJOR, minor), - ts, ts->chip_name); + ts, "%s", ts->chip_name); if (IS_ERR(ts_class_dev)) { error = PTR_ERR(ts_class_dev); ts_class_dev = NULL; @@ -3600,7 +3600,7 @@ int himax_chip_common_init(void) E("%s: alloc i_CTPM_firmware_name failed\n", __func__); goto firmware_name_alloc_failed; } - if (pdata->panel_supplier) + if (strlen(pdata->panel_supplier)) snprintf(i_CTPM_firmware_name, HIMAX_FILE_NAME_LENGTH, "%s_Himax_firmware.bin", pdata->panel_supplier); else diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c b/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c index 9c5e9b0f8c98..78b3d6bb745a 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c @@ -1675,7 +1675,7 @@ static int himax_parse_criteria_file(void) if (hx_self_test_file_name == NULL) { E("file name is NULL\n"); hx_self_test_file_name = kzalloc(80, GFP_KERNEL); - if (private_ts->pdata->panel_supplier) + if (strlen(private_ts->pdata->panel_supplier)) snprintf(hx_self_test_file_name, 60, "%s_hx_criteria.csv", private_ts->pdata->panel_supplier); else snprintf(hx_self_test_file_name, 16, "hx_criteria.csv"); @@ -1862,7 +1862,7 @@ static int himax_chip_self_test(void) #if defined(HIMAX_V2_MULTI_BIN)||defined(HX_CODE_OVERLAY) uint8_t normalfw[32] = "Himax_firmware.bin"; uint8_t mpapfw[32] = "Himax_mpfw.bin"; - if (private_ts->pdata->panel_supplier) { + if (strlen(private_ts->pdata->panel_supplier)) { snprintf(normalfw, 32, "%s_Himax_firmware.bin", private_ts->pdata->panel_supplier); snprintf(mpapfw, 32, "%s_Himax_mpfw.bin", private_ts->pdata->panel_supplier); } diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c index bb222d90c18d..9c216080b309 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c @@ -203,6 +203,7 @@ int himax_parse_dt(struct himax_ts_data *ts, himax_vk_parser(dt, pdata); + memset(pdata->panel_supplier, '\0', 16 * sizeof(char)); chosen = of_find_node_by_name(NULL, "chosen"); if (chosen) { const char *supplier; @@ -1068,12 +1069,12 @@ int himax_chip_common_remove(struct spi_device *spi) return 0; } -static const struct dev_pm_ops himax_common_pm_ops = { #if (!defined(CONFIG_FB)) && (!defined(CONFIG_DRM)) +static const struct dev_pm_ops himax_common_pm_ops = { .suspend = himax_common_suspend, .resume = himax_common_resume, -#endif }; +#endif #ifdef CONFIG_OF static const struct of_device_id himax_match_table[] = {