linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Carl Philipp Klemm <philipp@uvos.xyz>, tony@atomide.com
Cc: kbuild-all@lists.01.org, linux-omap@vger.kernel.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2] Drivers: input: misc: Add driver touchscreen-buttons to support physically labeled buttons on touch screen surfaces
Date: Tue, 3 Nov 2020 07:55:05 +0800	[thread overview]
Message-ID: <202011030714.XsF5q2pe-lkp@intel.com> (raw)
In-Reply-To: <20201029180448.e3aadaf2422d58470a9d0fcc@uvos.xyz>

[-- Attachment #1: Type: text/plain, Size: 10330 bytes --]

Hi Carl,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on input/next]
[also build test WARNING on v5.10-rc2 next-20201102]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Carl-Philipp-Klemm/Drivers-input-misc-Add-driver-touchscreen-buttons-to-support-physically-labeled-buttons-on-touch-screen-surfaces/20201030-010622
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/00fd93a32ffbfc2ce311ed11e49a596eae970933
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Carl-Philipp-Klemm/Drivers-input-misc-Add-driver-touchscreen-buttons-to-support-physically-labeled-buttons-on-touch-screen-surfaces/20201030-010622
        git checkout 00fd93a32ffbfc2ce311ed11e49a596eae970933
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/input/misc/touchscreen-buttons.c: In function 'touchscreen_buttons_input_event':
   drivers/input/misc/touchscreen-buttons.c:179:85: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     179 |  } else if (buttons->queue.lastindex < EVENT_QUEUE_SIZE && buttons->queue.lastindex >= 0) {
         |                                                                                     ^~
   drivers/input/misc/touchscreen-buttons.c: At top level:
>> drivers/input/misc/touchscreen-buttons.c:230:6: warning: no previous prototype for 'merge_task_handler' [-Wmissing-prototypes]
     230 | void merge_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:240:6: warning: no previous prototype for 'close_task_handler' [-Wmissing-prototypes]
     240 | void close_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:250:6: warning: no previous prototype for 'open_task_handler' [-Wmissing-prototypes]
     250 | void open_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:382:5: warning: no previous prototype for 'touchscreen_buttons_idev_opened' [-Wmissing-prototypes]
     382 | int touchscreen_buttons_idev_opened(struct input_dev *idev)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:405:6: warning: no previous prototype for 'touchscreen_buttons_idev_closed' [-Wmissing-prototypes]
     405 | void touchscreen_buttons_idev_closed(struct input_dev *idev)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/merge_task_handler +230 drivers/input/misc/touchscreen-buttons.c

   229	
 > 230	void merge_task_handler(struct work_struct *work)
   231	{
   232		struct touchscreen_buttons *buttons = container_of(work, struct touchscreen_buttons, merge_task);
   233	
   234		mutex_lock(&buttons->mutex);
   235		if (buttons->ts_handle && buttons->ts_handle->dev)
   236			touchscreen_buttons_merge_capabilitys(buttons->filtered_ts_idev, buttons->ts_handle->dev);
   237		mutex_unlock(&buttons->mutex);
   238	}
   239	
 > 240	void close_task_handler(struct work_struct *work)
   241	{
   242		struct touchscreen_buttons *buttons = container_of(work, struct touchscreen_buttons, close_task);
   243	
   244		mutex_lock(&buttons->mutex);
   245		if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0)
   246			input_close_device(buttons->ts_handle);
   247		mutex_unlock(&buttons->mutex);
   248	}
   249	
 > 250	void open_task_handler(struct work_struct *work)
   251	{
   252		struct touchscreen_buttons *buttons = container_of(work, struct touchscreen_buttons, open_task);
   253		int error;
   254	
   255		mutex_lock(&buttons->mutex);
   256		if (buttons && buttons->ts_handle) {
   257			error = input_open_device(buttons->ts_handle);
   258			if (error) {
   259				dev_err(buttons->dev, "Failed to open input device, error %d\n", error);
   260				input_unregister_handle(buttons->ts_handle);
   261				kfree(buttons->ts_handle);
   262				buttons->ts_handle = NULL;
   263			}
   264		}
   265		mutex_unlock(&buttons->mutex);
   266	}
   267	
   268	static int touchscreen_buttons_input_connect(struct input_handler *handler,
   269						     struct input_dev *dev, const struct input_device_id *id)
   270	{
   271		struct touchscreen_buttons *buttons;
   272	
   273		buttons = handler->private;
   274	
   275		mutex_lock(&buttons->mutex);
   276	
   277		if ((!buttons->ts_handle && device_match_of_node(&dev->dev, buttons->map->ts_node)) ||
   278			(dev->dev.parent && device_match_of_node(dev->dev.parent, buttons->map->ts_node))) {
   279			int error;
   280	
   281			dev_info(buttons->dev, "Binding to device: %s\n", dev_name(&dev->dev));
   282	
   283			buttons->ts_handle = kzalloc(sizeof(*buttons->ts_handle), GFP_KERNEL);
   284			if (!buttons->ts_handle) {
   285				mutex_unlock(&buttons->mutex);
   286				return -ENOMEM;
   287			}
   288	
   289			buttons->ts_handle->dev = dev;
   290			buttons->ts_handle->handler = handler;
   291			buttons->ts_handle->name = "touchscreen-buttons";
   292			buttons->ts_handle->private = handler->private;
   293			buttons->queue.lastindex = 0;
   294	
   295			error = input_register_handle(buttons->ts_handle);
   296			if (error) {
   297				dev_err(buttons->dev, "Failed to register input handler, error %d\n", error);
   298				kfree(buttons->ts_handle);
   299				buttons->ts_handle = NULL;
   300				mutex_unlock(&buttons->mutex);
   301				return error;
   302			}
   303	
   304			queue_work(buttons->workqueue, &buttons->merge_task);
   305	
   306			if (buttons->filtered_ts_idev->users > 0 && buttons->ts_handle->open == 0)
   307				queue_work(buttons->workqueue, &buttons->open_task);
   308		}
   309	
   310		mutex_unlock(&buttons->mutex);
   311		return 0;
   312	}
   313	
   314	static void touchscreen_buttons_input_disconnect(struct input_handle *handle)
   315	{
   316		struct touchscreen_buttons *buttons;
   317	
   318		buttons = handle->private;
   319	
   320		mutex_lock(&buttons->mutex);
   321		if (handle == buttons->ts_handle) {
   322			input_close_device(handle);
   323			input_unregister_handle(handle);
   324			kfree(handle);
   325			buttons->ts_handle = NULL;
   326			dev_info(buttons->dev, "Touchscreen device disconnected buttons disabled\n");
   327		} else {
   328			dev_err(buttons->dev, "Unknown device disconnected, %p should be %p", handle,
   329				buttons->ts_handle);
   330		}
   331		mutex_unlock(&buttons->mutex);
   332	}
   333	
   334	static struct touchscreen_button_map
   335	*touchscreen_buttons_get_devtree_pdata(struct device *dev)
   336	{
   337		struct touchscreen_button_map *map;
   338		struct fwnode_handle *child_node;
   339		struct device_node *node;
   340		int i;
   341	
   342		map = kzalloc(sizeof(*map), GFP_KERNEL);
   343		if (!map)
   344			return ERR_PTR(-ENOMEM);
   345	
   346		map->count = device_get_child_node_count(dev);
   347		if (map->count == 0)
   348			return ERR_PTR(-ENODEV);
   349	
   350		map->buttons = kcalloc(map->count, sizeof(*map->buttons), GFP_KERNEL);
   351		if (!map->buttons)
   352			return ERR_PTR(-ENOMEM);
   353	
   354		node = dev->of_node;
   355		map->ts_node = of_parse_phandle(node, "touchscreen_phandle", 0);
   356		if (!map->ts_node) {
   357			dev_err(dev, "touchscreen_phandle node missing\n");
   358			return ERR_PTR(-ENODEV);
   359		}
   360	
   361		dev_info(dev, "Device_node name: %s\n", map->ts_node->name);
   362	
   363		i = 0;
   364		device_for_each_child_node(dev, child_node) {
   365			struct touchscreen_button *button;
   366	
   367			button = &map->buttons[i];
   368	
   369			fwnode_property_read_u32(child_node, "x-position", &button->x);
   370			fwnode_property_read_u32(child_node, "y-position", &button->y);
   371			fwnode_property_read_u32(child_node, "x-size", &button->width);
   372			fwnode_property_read_u32(child_node, "y-size", &button->height);
   373			fwnode_property_read_u32(child_node, "keycode", &button->keycode);
   374			dev_info(dev,
   375				 "Adding button at x=%u y=%u size %u x %u keycode=%u\n",
   376				 button->x, button->y, button->width, button->height, button->keycode);
   377			++i;
   378		}
   379		return map;
   380	}
   381	
 > 382	int touchscreen_buttons_idev_opened(struct input_dev *idev)
   383	{
   384		struct touchscreen_buttons *buttons;
   385	
   386		buttons = dev_get_drvdata(idev->dev.parent);
   387	
   388		mutex_lock(&buttons->mutex);
   389		if (buttons && buttons->ts_handle) {
   390			if (buttons->ts_handle->open == 0) {
   391				queue_work(buttons->workqueue, &buttons->open_task);
   392				dev_dbg(idev->dev.parent, "idev opened\n");
   393			} else {
   394				dev_info(idev->dev.parent, "idev allready opened\n");
   395			}
   396		} else {
   397			dev_warn(idev->dev.parent,
   398				 "Input device opend but touchscreen not opened. %p %p\n", buttons,
   399				 buttons->ts_handle);
   400		}
   401		mutex_unlock(&buttons->mutex);
   402		return 0;
   403	}
   404	
 > 405	void touchscreen_buttons_idev_closed(struct input_dev *idev)
   406	{
   407		struct touchscreen_buttons *buttons;
   408	
   409		buttons = dev_get_drvdata(idev->dev.parent);
   410	
   411		mutex_lock(&buttons->mutex);
   412		if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0) {
   413			queue_work(buttons->workqueue, &buttons->close_task);
   414			dev_dbg(idev->dev.parent, "idev closed\n");
   415		}
   416		mutex_unlock(&buttons->mutex);
   417	}
   418	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 58757 bytes --]

  reply	other threads:[~2020-11-02 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 17:04 [PATCH v2] Drivers: input: misc: Add driver touchscreen-buttons to support physically labeled buttons on touch screen surfaces Carl Philipp Klemm
2020-11-02 23:55 ` kernel test robot [this message]
2020-11-03 12:34 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202011030714.XsF5q2pe-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=philipp@uvos.xyz \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).