[linusw-nomadik:ux500-codina-v5.17-rc1 6/12] drivers/input/touchscreen/zinitix.c:338 zinitix_report_fingers() warn: add some parenthesis here?

Dan Carpenter dan.carpenter at oracle.com
Sun Feb 27 22:48:18 PST 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ux500-codina-v5.17-rc1
head:   55196848adbcea2ea36561a056bb610bf3ab40bf
commit: 727f5e5be135b8f1f94922093b5c88565fdadcb0 [6/12] Input: zinitix - Do not report shadow fingers
config: microblaze-randconfig-m031-20220226 (https://download.01.org/0day-ci/archive/20220226/202202261608.xrQpogW4-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>

smatch warnings:
drivers/input/touchscreen/zinitix.c:338 zinitix_report_fingers() warn: add some parenthesis here?
drivers/input/touchscreen/zinitix.c:338 zinitix_report_fingers() warn: maybe use && instead of &

vim +338 drivers/input/touchscreen/zinitix.c

727f5e5be135b8 Linus Walleij 2022-02-14  322  static void zinitix_report_fingers(struct bt541_ts_data *bt541, struct touch_event *te)
26822652c85eff Michael Srba  2020-10-04  323  {
727f5e5be135b8 Linus Walleij 2022-02-14  324  	struct point_coord *p;
727f5e5be135b8 Linus Walleij 2022-02-14  325  	u16 x, y;
727f5e5be135b8 Linus Walleij 2022-02-14  326  	unsigned long fmask;
727f5e5be135b8 Linus Walleij 2022-02-14  327  	int i;
727f5e5be135b8 Linus Walleij 2022-02-14  328  
727f5e5be135b8 Linus Walleij 2022-02-14  329  	/*
727f5e5be135b8 Linus Walleij 2022-02-14  330  	 * If the corresponding finger is not active, do not report
727f5e5be135b8 Linus Walleij 2022-02-14  331  	 * what is happening on it.
727f5e5be135b8 Linus Walleij 2022-02-14  332  	 */
727f5e5be135b8 Linus Walleij 2022-02-14  333  	fmask = te->finger_mask;
727f5e5be135b8 Linus Walleij 2022-02-14  334  	for_each_set_bit(i, &fmask, MAX_SUPPORTED_FINGER_NUM) {
727f5e5be135b8 Linus Walleij 2022-02-14  335  		p = &te->point_coord[i];
727f5e5be135b8 Linus Walleij 2022-02-14  336  
727f5e5be135b8 Linus Walleij 2022-02-14  337  		/* Skip nonexisting fingers */
727f5e5be135b8 Linus Walleij 2022-02-14 @338  		if (!p->sub_status & SUB_BIT_EXIST)

Supposed to be: if (!(p->sub_status & SUB_BIT_EXIST))

727f5e5be135b8 Linus Walleij 2022-02-14  339  			continue;
727f5e5be135b8 Linus Walleij 2022-02-14  340  
727f5e5be135b8 Linus Walleij 2022-02-14  341  		x = le16_to_cpu(p->x);
727f5e5be135b8 Linus Walleij 2022-02-14  342  		y = le16_to_cpu(p->y);
727f5e5be135b8 Linus Walleij 2022-02-14  343  
727f5e5be135b8 Linus Walleij 2022-02-14  344  		input_mt_slot(bt541->input_dev, i);
727f5e5be135b8 Linus Walleij 2022-02-14  345  
727f5e5be135b8 Linus Walleij 2022-02-14  346  		if (p->sub_status & BIT_DOWN) {
727f5e5be135b8 Linus Walleij 2022-02-14  347  			/* Finger down */
727f5e5be135b8 Linus Walleij 2022-02-14  348  			input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER, true);
727f5e5be135b8 Linus Walleij 2022-02-14  349  			touchscreen_report_pos(bt541->input_dev, &bt541->prop, x, y, true);
727f5e5be135b8 Linus Walleij 2022-02-14  350  			input_report_abs(bt541->input_dev, ABS_MT_TOUCH_MAJOR, p->width);
727f5e5be135b8 Linus Walleij 2022-02-14  351  			dev_dbg(&bt541->client->dev, "finger %d down (%u, %u)\n", i, x, y);
727f5e5be135b8 Linus Walleij 2022-02-14  352  		} else if (p->sub_status & BIT_UP) {
727f5e5be135b8 Linus Walleij 2022-02-14  353  			/* Release finger */
727f5e5be135b8 Linus Walleij 2022-02-14  354  			input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER, false);
727f5e5be135b8 Linus Walleij 2022-02-14  355  			touchscreen_report_pos(bt541->input_dev, &bt541->prop, x, y, true);
727f5e5be135b8 Linus Walleij 2022-02-14  356  			input_report_abs(bt541->input_dev, ABS_MT_TOUCH_MAJOR, 0);
727f5e5be135b8 Linus Walleij 2022-02-14  357  			dev_dbg(&bt541->client->dev, "finger %d up (%u, %u)\n", i, x, y);
727f5e5be135b8 Linus Walleij 2022-02-14  358  		} else if (p->sub_status & BIT_MOVE) {
727f5e5be135b8 Linus Walleij 2022-02-14  359  			/* Finger moves while pressed down */
26822652c85eff Michael Srba  2020-10-04  360  			input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER, true);
727f5e5be135b8 Linus Walleij 2022-02-14  361  			touchscreen_report_pos(bt541->input_dev, &bt541->prop, x, y, true);
26822652c85eff Michael Srba  2020-10-04  362  			input_report_abs(bt541->input_dev, ABS_MT_TOUCH_MAJOR, p->width);
727f5e5be135b8 Linus Walleij 2022-02-14  363  			dev_dbg(&bt541->client->dev, "finger %d move (%u, %u)\n", i, x, y);
727f5e5be135b8 Linus Walleij 2022-02-14  364  		} else {
727f5e5be135b8 Linus Walleij 2022-02-14  365  			dev_dbg(&bt541->client->dev, "unknown finger event\n");
727f5e5be135b8 Linus Walleij 2022-02-14  366  		}
727f5e5be135b8 Linus Walleij 2022-02-14  367  	}
26822652c85eff Michael Srba  2020-10-04  368  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org




More information about the linux-arm-kernel mailing list