Re: [PATCH 1/3] input: evdev: introduce new evdev interface
From: kbuild test robot
Date: Fri Nov 27 2015 - 05:36:31 EST
Hi WEN,
[auto build test ERROR on: input/next]
[also build test ERROR on: v4.4-rc2 next-20151127]
url: https://github.com/0day-ci/linux/commits/WEN-Pingbo/introduce-new-evdev-interface-type/20151127-180438
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: i386-randconfig-s0-201547 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
Note: the linux-review/WEN-Pingbo/introduce-new-evdev-interface-type/20151127-180438 HEAD fc81990de5842e76f794f755e095e4c5e55f8caa builds fine.
It only hurts bisectibility.
All error/warnings (new ones prefixed by >>):
drivers/input/misc/uinput.c: In function 'uinput_inject_events':
>> drivers/input/misc/uinput.c:442:28: error: too few arguments to function 'input_event_size'
if (count != 0 && count < input_event_size())
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
drivers/input/misc/uinput.c:445:17: error: too few arguments to function 'input_event_size'
while (bytes + input_event_size() <= count) {
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
>> drivers/input/misc/uinput.c:452:45: warning: passing argument 2 of 'input_event_from_user' from incompatible pointer type [-Wincompatible-pointer-types]
if (input_event_from_user(buffer + bytes, &ev))
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:102:5: note: expected 'struct input_value *' but argument is of type 'struct input_event *'
int input_event_from_user(const char __user *buffer,
^
>> drivers/input/misc/uinput.c:452:7: error: too few arguments to function 'input_event_from_user'
if (input_event_from_user(buffer + bytes, &ev))
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:102:5: note: declared here
int input_event_from_user(const char __user *buffer,
^
drivers/input/misc/uinput.c:456:12: error: too few arguments to function 'input_event_size'
bytes += input_event_size();
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
drivers/input/misc/uinput.c: In function 'uinput_events_to_user':
drivers/input/misc/uinput.c:508:16: error: too few arguments to function 'input_event_size'
while (read + input_event_size() <= count &&
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
>> drivers/input/misc/uinput.c:511:42: warning: passing argument 2 of 'input_event_to_user' from incompatible pointer type [-Wincompatible-pointer-types]
if (input_event_to_user(buffer + read, &event))
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:105:5: note: expected 'const struct input_value *' but argument is of type 'struct input_event *'
int input_event_to_user(char __user *buffer, const struct input_value *event,
^
>> drivers/input/misc/uinput.c:511:7: error: too few arguments to function 'input_event_to_user'
if (input_event_to_user(buffer + read, &event))
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:105:5: note: declared here
int input_event_to_user(char __user *buffer, const struct input_value *event,
^
drivers/input/misc/uinput.c:514:11: error: too few arguments to function 'input_event_size'
read += input_event_size();
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
drivers/input/misc/uinput.c: In function 'uinput_read':
drivers/input/misc/uinput.c:526:28: error: too few arguments to function 'input_event_size'
if (count != 0 && count < input_event_size())
^
In file included from drivers/input/misc/uinput.c:43:0:
drivers/input/misc/../input-compat.h:84:22: note: declared here
static inline size_t input_event_size(int if_type)
^
vim +/input_event_size +442 drivers/input/misc/uinput.c
cbf05413 Ryan Mallon 2013-09-18 436 static ssize_t uinput_inject_events(struct uinput_device *udev,
54ce165e Dmitry Torokhov 2012-07-29 437 const char __user *buffer, size_t count)
^1da177e Linus Torvalds 2005-04-16 438 {
^1da177e Linus Torvalds 2005-04-16 439 struct input_event ev;
cbf05413 Ryan Mallon 2013-09-18 440 size_t bytes = 0;
^1da177e Linus Torvalds 2005-04-16 441
cbf05413 Ryan Mallon 2013-09-18 @442 if (count != 0 && count < input_event_size())
29506415 Dmitry Torokhov 2005-11-20 443 return -EINVAL;
29506415 Dmitry Torokhov 2005-11-20 444
cbf05413 Ryan Mallon 2013-09-18 @445 while (bytes + input_event_size() <= count) {
cbf05413 Ryan Mallon 2013-09-18 446 /*
cbf05413 Ryan Mallon 2013-09-18 447 * Note that even if some events were fetched successfully
cbf05413 Ryan Mallon 2013-09-18 448 * we are still going to return EFAULT instead of partial
cbf05413 Ryan Mallon 2013-09-18 449 * count to let userspace know that it got it's buffers
cbf05413 Ryan Mallon 2013-09-18 450 * all wrong.
cbf05413 Ryan Mallon 2013-09-18 451 */
cbf05413 Ryan Mallon 2013-09-18 @452 if (input_event_from_user(buffer + bytes, &ev))
^1da177e Linus Torvalds 2005-04-16 453 return -EFAULT;
29506415 Dmitry Torokhov 2005-11-20 454
^1da177e Linus Torvalds 2005-04-16 455 input_event(udev->dev, ev.type, ev.code, ev.value);
cbf05413 Ryan Mallon 2013-09-18 456 bytes += input_event_size();
cbf05413 Ryan Mallon 2013-09-18 457 }
^1da177e Linus Torvalds 2005-04-16 458
cbf05413 Ryan Mallon 2013-09-18 459 return bytes;
29506415 Dmitry Torokhov 2005-11-20 460 }
29506415 Dmitry Torokhov 2005-11-20 461
54ce165e Dmitry Torokhov 2012-07-29 462 static ssize_t uinput_write(struct file *file, const char __user *buffer,
54ce165e Dmitry Torokhov 2012-07-29 463 size_t count, loff_t *ppos)
29506415 Dmitry Torokhov 2005-11-20 464 {
29506415 Dmitry Torokhov 2005-11-20 465 struct uinput_device *udev = file->private_data;
29506415 Dmitry Torokhov 2005-11-20 466 int retval;
29506415 Dmitry Torokhov 2005-11-20 467
22ae19c6 Dmitry Torokhov 2012-07-29 468 if (count == 0)
22ae19c6 Dmitry Torokhov 2012-07-29 469 return 0;
22ae19c6 Dmitry Torokhov 2012-07-29 470
221979aa Dmitry Torokhov 2006-02-19 471 retval = mutex_lock_interruptible(&udev->mutex);
29506415 Dmitry Torokhov 2005-11-20 472 if (retval)
29506415 Dmitry Torokhov 2005-11-20 473 return retval;
29506415 Dmitry Torokhov 2005-11-20 474
29506415 Dmitry Torokhov 2005-11-20 475 retval = udev->state == UIST_CREATED ?
cbf05413 Ryan Mallon 2013-09-18 476 uinput_inject_events(udev, buffer, count) :
29506415 Dmitry Torokhov 2005-11-20 477 uinput_setup_device(udev, buffer, count);
29506415 Dmitry Torokhov 2005-11-20 478
221979aa Dmitry Torokhov 2006-02-19 479 mutex_unlock(&udev->mutex);
29506415 Dmitry Torokhov 2005-11-20 480
29506415 Dmitry Torokhov 2005-11-20 481 return retval;
^1da177e Linus Torvalds 2005-04-16 482 }
^1da177e Linus Torvalds 2005-04-16 483
929d1af5 Dmitry Torokhov 2012-07-29 484 static bool uinput_fetch_next_event(struct uinput_device *udev,
929d1af5 Dmitry Torokhov 2012-07-29 485 struct input_event *event)
929d1af5 Dmitry Torokhov 2012-07-29 486 {
929d1af5 Dmitry Torokhov 2012-07-29 487 bool have_event;
929d1af5 Dmitry Torokhov 2012-07-29 488
929d1af5 Dmitry Torokhov 2012-07-29 489 spin_lock_irq(&udev->dev->event_lock);
929d1af5 Dmitry Torokhov 2012-07-29 490
929d1af5 Dmitry Torokhov 2012-07-29 491 have_event = udev->head != udev->tail;
929d1af5 Dmitry Torokhov 2012-07-29 492 if (have_event) {
929d1af5 Dmitry Torokhov 2012-07-29 493 *event = udev->buff[udev->tail];
929d1af5 Dmitry Torokhov 2012-07-29 494 udev->tail = (udev->tail + 1) % UINPUT_BUFFER_SIZE;
929d1af5 Dmitry Torokhov 2012-07-29 495 }
929d1af5 Dmitry Torokhov 2012-07-29 496
929d1af5 Dmitry Torokhov 2012-07-29 497 spin_unlock_irq(&udev->dev->event_lock);
929d1af5 Dmitry Torokhov 2012-07-29 498
929d1af5 Dmitry Torokhov 2012-07-29 499 return have_event;
929d1af5 Dmitry Torokhov 2012-07-29 500 }
929d1af5 Dmitry Torokhov 2012-07-29 501
22ae19c6 Dmitry Torokhov 2012-07-29 502 static ssize_t uinput_events_to_user(struct uinput_device *udev,
22ae19c6 Dmitry Torokhov 2012-07-29 503 char __user *buffer, size_t count)
^1da177e Linus Torvalds 2005-04-16 504 {
929d1af5 Dmitry Torokhov 2012-07-29 505 struct input_event event;
22ae19c6 Dmitry Torokhov 2012-07-29 506 size_t read = 0;
^1da177e Linus Torvalds 2005-04-16 507
22ae19c6 Dmitry Torokhov 2012-07-29 @508 while (read + input_event_size() <= count &&
22ae19c6 Dmitry Torokhov 2012-07-29 509 uinput_fetch_next_event(udev, &event)) {
f40033ac David Herrmann 2012-07-29 510
00ce756c Dmitry Torokhov 2012-07-29 @511 if (input_event_to_user(buffer + read, &event))
00ce756c Dmitry Torokhov 2012-07-29 512 return -EFAULT;
^1da177e Linus Torvalds 2005-04-16 513
22ae19c6 Dmitry Torokhov 2012-07-29 514 read += input_event_size();
:::::: The code at line 442 was first introduced by commit
:::::: cbf0541374e2fcfdfdcaf8365c957a137eb9feea Input: uinput - support injecting multiple events in one write() call
:::::: TO: Ryan Mallon <rmallon@xxxxxxxxx>
:::::: CC: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data