1
0
Fork 0

touch: pt: resolved 'ISO C90 forbids variable length array data' warnings

zero-sugar
Michal Koziel 2021-04-21 14:04:22 +02:00 committed by mkemlogic
parent 003f35d627
commit 745322b72f
4 changed files with 16 additions and 14 deletions

View File

@ -7294,16 +7294,16 @@ const struct pt_tch_abs_params tch_hdr_default[PT_TCH_NUM_HDR] = {
*/
const struct pt_tch_abs_params tch_abs_default[PT_TCH_NUM_ABS] = {
/* byte offset, size, min, max, bit offset, report */
{0x02, 0x02, 0x00, 0x10000, 0x00, 0x01}, /* X */
{0x04, 0x02, 0x00, 0x10000, 0x00, 0x01}, /* Y */
{0x06, 0x01, 0x00, 0x100, 0x00, 0x01}, /* P (Z) */
{0x01, 0x01, 0x00, 0x20, 0x00, 0x01}, /* TOUCH ID */
{0x01, 0x01, 0x00, 0x04, 0x05, 0x01}, /* EVENT ID */
{0x00, 0x01, 0x00, 0x08, 0x00, 0x01}, /* OBJECT ID */
{0x01, 0x01, 0x00, 0x02, 0x07, 0x01}, /* LIFTOFF */
{0x07, 0x01, 0x00, 0x100, 0x00, 0x01}, /* TOUCH_MAJOR */
{0x08, 0x01, 0x00, 0x100, 0x00, 0x01}, /* TOUCH_MINOR */
{0x09, 0x01, 0x00, 0x100, 0x00, 0x01}, /* ORIENTATION */
{0x02, 0x02, 0x00, 0x10000, 0x00, 0x01}, /* X */
{0x04, 0x02, 0x00, 0x10000, 0x00, 0x01}, /* Y */
{0x06, 0x01, 0x00, 0x100, 0x00, 0x01}, /* P (Z) */
{0x01, 0x01, 0x00, PT_TCH_T_MAX,0x00, 0x01}, /* TOUCH ID */
{0x01, 0x01, 0x00, 0x04, 0x05, 0x01}, /* EVENT ID */
{0x00, 0x01, 0x00, 0x08, 0x00, 0x01}, /* OBJECT ID */
{0x01, 0x01, 0x00, 0x02, 0x07, 0x01}, /* LIFTOFF */
{0x07, 0x01, 0x00, 0x100, 0x00, 0x01}, /* TOUCH_MAJOR */
{0x08, 0x01, 0x00, 0x100, 0x00, 0x01}, /* TOUCH_MINOR */
{0x09, 0x01, 0x00, 0x100, 0x00, 0x01}, /* ORIENTATION */
};
/*******************************************************************************
@ -14473,8 +14473,8 @@ static ssize_t pt_pip2_exit_bl_show(struct device *dev,
struct pt_core_data *cd = dev_get_drvdata(dev);
ssize_t ret = 0;
int rc = 0;
int status_str_buf_len = 50;
u8 status_str[status_str_buf_len];
u8 status_str[50];
int status_str_buf_len = sizeof(status_str);
rc = pt_pip2_exit_bl_(cd, status_str, status_str_buf_len);
/*

View File

@ -558,7 +558,7 @@ static int pt_ldr_prog_row_(struct device *dev,
struct pt_hex_image *row_image)
{
u16 length = row_image->row_size + 3;
u8 data[3 + row_image->row_size];
u8 data[3 + sizeof(row_image->row_data)];
u8 offset = 0;
data[offset++] = row_image->array_id;

View File

@ -304,7 +304,7 @@ static void pt_get_mt_touches(struct pt_mt_data *md,
struct pt_sysinfo *si = md->si;
int sig;
int i, j, t = 0;
DECLARE_BITMAP(ids, si->tch_abs[PT_TCH_T].max);
DECLARE_BITMAP(ids, PT_TCH_T_MAX);
int mt_sync_count = 0;
u8 *tch_addr;

View File

@ -928,6 +928,8 @@ enum pt_tch_abs { /* for ordering within the extracted touch data array */
PT_TCH_NUM_ABS,
};
#define PT_TCH_T_MAX 0x20
enum pt_tch_hdr {
PT_TCH_TIME, /* SCAN TIME */
PT_TCH_NUM, /* NUMBER OF RECORDS */