input: touchscreen: cyttsp5: fix compilation warnings
Fix compilation warnings and errors after enable LLVM.
Change-Id: I2d1209d008e85c2d856387644e5fcf5113b0e7af
Signed-off-by: Fei Mao <feim1@codeaurora.org>
diff --git a/drivers/input/touchscreen/cyttsp5/cyttsp5_device_access.c b/drivers/input/touchscreen/cyttsp5/cyttsp5_device_access.c
index 14dcdb5..f501b5c 100644
--- a/drivers/input/touchscreen/cyttsp5/cyttsp5_device_access.c
+++ b/drivers/input/touchscreen/cyttsp5/cyttsp5_device_access.c
@@ -1666,11 +1666,11 @@
if (no_builtin_file)
goto no_builtin;
- if (test_item && CM_ENABLED)
+ if (test_item & CM_ENABLED)
validate_cm_test_results(dev, configuration, cmcp_info,
result, &final_pass, test_item);
- if (test_item && CP_ENABLED)
+ if (test_item & CP_ENABLED)
validate_cp_test_results(dev, configuration, cmcp_info,
result, &final_pass, test_item);
no_builtin:
diff --git a/drivers/input/touchscreen/cyttsp5/cyttsp5_loader.c b/drivers/input/touchscreen/cyttsp5/cyttsp5_loader.c
index c7dbafa..9d6ae8a 100644
--- a/drivers/input/touchscreen/cyttsp5/cyttsp5_loader.c
+++ b/drivers/input/touchscreen/cyttsp5/cyttsp5_loader.c
@@ -115,7 +115,7 @@
return cyttsp5_get_module_data(dev, &loader_module);
}
-#if CYTTSP5_FW_UPGRADE \
+#if defined(CYTTSP5_FW_UPGRADE) \
|| defined(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE)
static u8 cyttsp5_get_panel_id(struct device *dev)
{
@@ -125,7 +125,7 @@
}
#endif
-#if CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE
+#if defined(CYTTSP5_FW_UPGRADE) || defined(CYTTSP5_TTCONFIG_UPGRADE)
/*
* return code:
* -1: Do not upgrade firmware
@@ -230,7 +230,7 @@
#endif /* CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE */
-#if CYTTSP5_FW_UPGRADE
+#ifdef CYTTSP5_FW_UPGRADE
static u8 *cyttsp5_get_row_(struct device *dev, u8 *row_buf,
u8 *image_buf, int size)
{
@@ -826,7 +826,7 @@
}
#endif /* CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE */
-#if CYTTSP5_TTCONFIG_UPGRADE
+#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_MANUAL_TTCONFIG_UPGRADE
static int cyttsp5_write_config_row_(struct device *dev, u8 ebid,
u16 row_number, u16 row_size, u8 *data)
{
@@ -967,9 +967,7 @@
return rc;
}
-#endif /* CYTTSP5_TTCONFIG_UPGRADE */
-#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_TTCONFIG_UPGRADE
static int cyttsp5_get_ttconfig_crc(struct device *dev,
const u8 *ttconfig_data, int ttconfig_size, u16 *crc)
{
@@ -1358,7 +1356,7 @@
if (!ld->si)
dev_err(dev, "%s: Fail get sysinfo pointer from core\n",
__func__);
-#if !CYTTSP5_FW_UPGRADE
+#if !defined(CYTTSP5_FW_UPGRADE)
dev_info(dev, "%s: No FW upgrade method selected!\n", __func__);
#endif
@@ -1378,7 +1376,7 @@
#endif
}
-#if CYTTSP5_FW_UPGRADE
+#ifdef CYTTSP5_FW_UPGRADE
static int cyttsp5_fw_upgrade_cb(struct device *dev)
{
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_PLATFORM_FW_UPGRADE
@@ -1489,7 +1487,7 @@
ld->dev = dev;
*data = ld;
-#if CYTTSP5_FW_UPGRADE
+#ifdef CYTTSP5_FW_UPGRADE
init_completion(&ld->int_running);
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_BINARY_FW_UPGRADE
init_completion(&ld->builtin_bin_fw_complete);
@@ -1500,7 +1498,7 @@
cmd->subscribe_attention(dev, CY_ATTEN_LOADER, CYTTSP5_LOADER_NAME,
cyttsp5_fw_upgrade_cb, CY_MODE_UNKNOWN);
#endif
-#if CYTTSP5_FW_UPGRADE || CYTTSP5_TTCONFIG_UPGRADE
+#if defined(CYTTSP5_FW_UPGRADE) || defined(CYTTSP5_TTCONFIG_UPGRADE)
init_completion(&ld->calibration_complete);
INIT_WORK(&ld->calibration_work, cyttsp5_calibrate_idacs);
#endif
@@ -1543,7 +1541,7 @@
{
struct cyttsp5_loader_data *ld = (struct cyttsp5_loader_data *)data;
-#if CYTTSP5_FW_UPGRADE
+#ifdef CYTTSP5_FW_UPGRADE
cmd->unsubscribe_attention(dev, CY_ATTEN_IRQ, CYTTSP5_LOADER_NAME,
cyttsp5_loader_attention, CY_MODE_BOOTLOADER);