forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/input/touchscreen/cyttsp5/cyttsp5_core.c
....@@ -1710,11 +1710,6 @@
17101710 if (length < read_length)
17111711 length = read_length;
17121712
1713
- if (length + 10 > CY_MAX_INPUT) {
1714
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
1715
- __func__, __LINE__, length + 10, CY_MAX_INPUT);
1716
- return -EINVAL;
1717
- }
17181713 memcpy(read_buf, &cd->response_buf[10], length);
17191714 *crc = get_unaligned_le16(&cd->response_buf[read_length + 10]);
17201715
....@@ -2486,11 +2481,6 @@
24862481 if (!data_len)
24872482 return -EPROTO;
24882483
2489
- if (data_len + 8 > CY_MAX_INPUT) {
2490
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
2491
- __func__, __LINE__, data_len, CY_MAX_INPUT);
2492
- return -EINVAL;
2493
- }
24942484 memcpy(return_data, &cd->response_buf[8], data_len);
24952485
24962486 return 0;
....@@ -3884,12 +3874,6 @@
38843874 tthe_print(cd, cd->input_buf, size, "OpModeData=");
38853875 #endif
38863876
3887
- if (si->desc.tch_header_size > CY_MAX_INPUT) {
3888
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
3889
- __func__, __LINE__, si->desc.tch_header_size, CY_MAX_INPUT);
3890
- return -EINVAL;
3891
- }
3892
-
38933877 memcpy(si->xy_mode, cd->input_buf, si->desc.tch_header_size);
38943878 cyttsp5_pr_buf(cd->dev, (u8 *)si->xy_mode, si->desc.tch_header_size,
38953879 "xy_mode");
....@@ -3900,13 +3884,6 @@
39003884 num_cur_tch = max_tch;
39013885
39023886 length = num_cur_tch * si->desc.tch_record_size;
3903
-
3904
- if ((length + si->desc.tch_header_size) > CY_MAX_INPUT) {
3905
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
3906
- __func__, __LINE__, length + si->desc.tch_header_size,
3907
- CY_MAX_INPUT);
3908
- return -EINVAL;
3909
- }
39103887
39113888 memcpy(si->xy_data, &cd->input_buf[si->desc.tch_header_size], length);
39123889 cyttsp5_pr_buf(cd->dev, (u8 *)si->xy_data, length, "xy_data");
....@@ -3954,12 +3931,6 @@
39543931 parade_debug(cd->dev, DEBUG_LEVEL_2, "%s: Received cmd interrupt\n",
39553932 __func__);
39563933
3957
- if (size > CY_MAX_INPUT) {
3958
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
3959
- __func__, __LINE__, size, CY_MAX_INPUT);
3960
- return -EINVAL;
3961
- }
3962
-
39633934 memcpy(cd->response_buf, cd->input_buf, size);
39643935
39653936 mutex_lock(&cd->system_lock);
....@@ -4002,17 +3973,12 @@
40023973 wake_up(&cd->wait_q);
40033974 mutex_unlock(&cd->system_lock);
40043975 return 0;
4005
- } else if (size == 2 || size >= CY_PIP_1P7_EMPTY_BUF || size > CY_MAX_INPUT) {
3976
+ } else if (size == 2 || size >= CY_PIP_1P7_EMPTY_BUF)
40063977 /*
40073978 * Before PIP 1.7, empty buffer is 0x0002;
40083979 * From PIP 1.7, empty buffer is 0xFFXX
40093980 */
4010
- if (size > CY_MAX_INPUT && size < CY_PIP_1P7_EMPTY_BUF)
4011
- dev_err(cd->dev, "%s:%d: size=%d is larger than the max %d!!!\n",
4012
- __func__, __LINE__, size, CY_MAX_INPUT);
4013
-
40143981 return 0;
4015
- }
40163982
40173983 report_id = cd->input_buf[2];
40183984 parade_debug(cd->dev, DEBUG_LEVEL_2, "%s: report_id:%X\n",