From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 08/12] HID: core: for input reports, process the usages by priority list
Date: Fri, 28 Jan 2022 21:52:41 +0800 [thread overview]
Message-ID: <202201282135.fedFj5tc-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 19756 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220126161832.3193805-9-benjamin.tissoires@redhat.com>
References: <20220126161832.3193805-9-benjamin.tissoires@redhat.com>
TO: Benjamin Tissoires <benjamin.tissoires@redhat.com>
TO: Jiri Kosina <jikos@kernel.org>
TO: Dmitry Torokhov <dmitry.torokhov@gmail.com>
TO: Jonathan Corbet <corbet@lwn.net>
TO: "Ahelenia Ziemiańska" <nabijaczleweli@nabijaczleweli.xyz>
TO: Ping Cheng <pinglinux@gmail.com>
TO: Aaron Armstrong Skomra <skomra@gmail.com>
TO: Jason Gerecke <killertofu@gmail.com>
TO: Peter Hutterer <peter.hutterer@who-t.net>
CC: linux-input(a)vger.kernel.org
CC: linux-doc(a)vger.kernel.org
Hi Benjamin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[also build test WARNING on v5.17-rc1 next-20220127]
[cannot apply to jikos-hid/for-next]
[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/Benjamin-Tissoires/HID-fix-for-generic-input-processing/20220127-002107
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: riscv-randconfig-c006-20220124 (https://download.01.org/0day-ci/archive/20220128/202201282135.fedFj5tc-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2a1b7aa016c0f4b5598806205bdfbab1ea2d92c4)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/5f297c23cba491924689834a01ef511263c9e547
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Benjamin-Tissoires/HID-fix-for-generic-input-processing/20220127-002107
git checkout 5f297c23cba491924689834a01ef511263c9e547
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:2353:2: note: Taking false branch
if (hdev->ll_driver->request)
^
drivers/hid/hid-core.c:2356:2: note: Calling '__hid_request'
__hid_request(hdev, report, reqtype);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1931:6: note: Assuming 'buf' is non-null
if (!buf)
^~~~
drivers/hid/hid-core.c:1931:2: note: Taking false branch
if (!buf)
^
drivers/hid/hid-core.c:1936:6: note: Assuming 'reqtype' is equal to HID_REQ_SET_REPORT
if (reqtype == HID_REQ_SET_REPORT)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1936:2: note: Taking true branch
if (reqtype == HID_REQ_SET_REPORT)
^
drivers/hid/hid-core.c:1937:3: note: Calling 'hid_output_report'
hid_output_report(report, buf);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1844:14: note: Field 'id' is <= 0
if (report->id > 0)
^
drivers/hid/hid-core.c:1844:2: note: Taking false branch
if (report->id > 0)
^
drivers/hid/hid-core.c:1848:14: note: Assuming 'n' is < field 'maxfield'
for (n = 0; n < report->maxfield; n++)
^~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1848:2: note: Loop condition is true. Entering loop body
for (n = 0; n < report->maxfield; n++)
^
drivers/hid/hid-core.c:1849:3: note: Calling 'hid_output_field'
hid_output_field(report->device, report->field[n], data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1811:2: note: 'size' initialized here
unsigned size = field->report_size;
^~~~~~~~~~~~~
drivers/hid/hid-core.c:1814:14: note: Assuming 'n' is < 'count'
for (n = 0; n < count; n++) {
^~~~~~~~~
drivers/hid/hid-core.c:1814:2: note: Loop condition is true. Entering loop body
for (n = 0; n < count; n++) {
^
drivers/hid/hid-core.c:1815:7: note: Assuming field 'logical_minimum' is < 0
if (field->logical_minimum < 0) /* signed values */
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1815:3: note: Taking true branch
if (field->logical_minimum < 0) /* signed values */
^
drivers/hid/hid-core.c:1816:4: note: Calling 'implement'
implement(hid, data, offset + n * size, size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1426:15: note: Assuming 'n' is <= 32
if (unlikely(n > 32)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
drivers/hid/hid-core.c:1426:2: note: Taking false branch
if (unlikely(n > 32)) {
^
drivers/hid/hid-core.c:1430:13: note: Assuming 'n' is >= 32
} else if (n < 32) {
^~~~~~
drivers/hid/hid-core.c:1430:9: note: Taking false branch
} else if (n < 32) {
^
drivers/hid/hid-core.c:1816:4: note: Returning from 'implement'
implement(hid, data, offset + n * size, size,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1814:14: note: Assuming 'n' is < 'count'
for (n = 0; n < count; n++) {
^~~~~~~~~
drivers/hid/hid-core.c:1814:2: note: Loop condition is true. Entering loop body
for (n = 0; n < count; n++) {
^
drivers/hid/hid-core.c:1815:14: note: Field 'logical_minimum' is < 0
if (field->logical_minimum < 0) /* signed values */
^
drivers/hid/hid-core.c:1815:3: note: Taking true branch
if (field->logical_minimum < 0) /* signed values */
^
drivers/hid/hid-core.c:1817:31: note: Passing the value 32 via 2nd parameter 'n'
s32ton(field->value[n], size));
^~~~
drivers/hid/hid-core.c:1817:7: note: Calling 's32ton'
s32ton(field->value[n], size));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1339:6: note: Assuming 'a' is 0
if (a && a != -1)
^
drivers/hid/hid-core.c:1339:8: note: Left side of '&&' is false
if (a && a != -1)
^
drivers/hid/hid-core.c:1341:21: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'int'
return value & ((1 << n) - 1);
^ ~
>> drivers/hid/hid-core.c:1665:30: warning: Although the value stored to 'field' is used in the enclosing expression, the value is never actually read from 'field' [clang-analyzer-deadcode.DeadStores]
hid_input_fetch_field(hid, field = report->field[a], data);
^ ~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:1665:30: note: Although the value stored to 'field' is used in the enclosing expression, the value is never actually read from 'field'
hid_input_fetch_field(hid, field = report->field[a], data);
^ ~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:2198:3: warning: Value stored to 'len' is never read [clang-analyzer-deadcode.DeadStores]
len += sprintf(buf + len, "%shidraw%d", len ? "," : "",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-core.c:2198:3: note: Value stored to 'len' is never read
len += sprintf(buf + len, "%shidraw%d", len ? "," : "",
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (4 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (4 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
38 warnings generated.
drivers/iio/humidity/hts221_core.c:183:13: warning: The result of the left shift is undefined due to shifting '2' by '31', which is unrepresentable in the unsigned version of the return type 'int' [clang-analyzer-core.UndefinedBinaryOperatorResult]
data = ((i << __ffs(avg->mask)) & avg->mask);
^
drivers/iio/humidity/hts221_core.c:486:6: note: Assuming 'ret' is 0
if (ret)
^~~
drivers/iio/humidity/hts221_core.c:486:2: note: Taking false branch
if (ret)
^
drivers/iio/humidity/hts221_core.c:489:2: note: Control jumps to 'case IIO_CHAN_INFO_OVERSAMPLING_RATIO:' at line 493
switch (mask) {
^
drivers/iio/humidity/hts221_core.c:494:3: note: Control jumps to 'case IIO_TEMP:' at line 498
switch (chan->type) {
^
drivers/iio/humidity/hts221_core.c:499:10: note: Calling 'hts221_update_avg'
ret = hts221_update_avg(hw, HTS221_SENSOR_T, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/iio/humidity/hts221_core.c:176:2: note: Loop condition is true. Entering loop body
for (i = 0; i < HTS221_AVG_DEPTH; i++)
^
drivers/iio/humidity/hts221_core.c:177:7: note: Assuming the condition is false
if (avg->avg_avl[i] == val)
vim +1665 drivers/hid/hid-core.c
dde5845a529ff7 Jiri Kosina 2006-12-08 1648
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1649 /*
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1650 * Analyse a received report, and fetch the data from it. The field
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1651 * content is stored for next report processing (we do differential
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1652 * reporting to the layer).
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1653 */
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1654 static void hid_process_report(struct hid_device *hid,
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1655 struct hid_report *report,
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1656 __u8 *data,
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1657 int interrupt)
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1658 {
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1659 unsigned int a;
5f297c23cba491 Benjamin Tissoires 2022-01-26 1660 struct hid_field_entry *entry;
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1661 struct hid_field *field;
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1662
5f297c23cba491 Benjamin Tissoires 2022-01-26 1663 /* first retrieve all incoming values in data */
5f297c23cba491 Benjamin Tissoires 2022-01-26 1664 for (a = 0; a < report->maxfield; a++)
5f297c23cba491 Benjamin Tissoires 2022-01-26 @1665 hid_input_fetch_field(hid, field = report->field[a], data);
5f297c23cba491 Benjamin Tissoires 2022-01-26 1666
5f297c23cba491 Benjamin Tissoires 2022-01-26 1667 if (!list_empty(&report->field_entry_list)) {
5f297c23cba491 Benjamin Tissoires 2022-01-26 1668 /* INPUT_REPORT, we have a priority list of fields */
5f297c23cba491 Benjamin Tissoires 2022-01-26 1669 list_for_each_entry(entry,
5f297c23cba491 Benjamin Tissoires 2022-01-26 1670 &report->field_entry_list,
5f297c23cba491 Benjamin Tissoires 2022-01-26 1671 list) {
5f297c23cba491 Benjamin Tissoires 2022-01-26 1672 field = entry->field;
5f297c23cba491 Benjamin Tissoires 2022-01-26 1673
5f297c23cba491 Benjamin Tissoires 2022-01-26 1674 if (field->flags & HID_MAIN_ITEM_VARIABLE)
5f297c23cba491 Benjamin Tissoires 2022-01-26 1675 hid_process_event(hid,
5f297c23cba491 Benjamin Tissoires 2022-01-26 1676 field,
5f297c23cba491 Benjamin Tissoires 2022-01-26 1677 &field->usage[entry->index],
5f297c23cba491 Benjamin Tissoires 2022-01-26 1678 field->new_value[entry->index],
5f297c23cba491 Benjamin Tissoires 2022-01-26 1679 interrupt);
5f297c23cba491 Benjamin Tissoires 2022-01-26 1680 else
5f297c23cba491 Benjamin Tissoires 2022-01-26 1681 hid_input_array_field(hid, field, interrupt);
5f297c23cba491 Benjamin Tissoires 2022-01-26 1682 }
5f297c23cba491 Benjamin Tissoires 2022-01-26 1683
5f297c23cba491 Benjamin Tissoires 2022-01-26 1684 /* we need to do the memcpy at the end for var items */
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1685 for (a = 0; a < report->maxfield; a++) {
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1686 field = report->field[a];
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1687
5f297c23cba491 Benjamin Tissoires 2022-01-26 1688 if (field->flags & HID_MAIN_ITEM_VARIABLE)
5f297c23cba491 Benjamin Tissoires 2022-01-26 1689 memcpy(field->value, field->new_value,
5f297c23cba491 Benjamin Tissoires 2022-01-26 1690 field->report_count * sizeof(__s32));
5f297c23cba491 Benjamin Tissoires 2022-01-26 1691 }
5f297c23cba491 Benjamin Tissoires 2022-01-26 1692 } else {
5f297c23cba491 Benjamin Tissoires 2022-01-26 1693 /* FEATURE_REPORT, regular processing */
5f297c23cba491 Benjamin Tissoires 2022-01-26 1694 for (a = 0; a < report->maxfield; a++) {
5f297c23cba491 Benjamin Tissoires 2022-01-26 1695 field = report->field[a];
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1696
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1697 if (field->flags & HID_MAIN_ITEM_VARIABLE)
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1698 hid_input_var_field(hid, field, interrupt);
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1699 else
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1700 hid_input_array_field(hid, field, interrupt);
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1701 }
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1702 }
5f297c23cba491 Benjamin Tissoires 2022-01-26 1703 }
d95c6e8572e0df Benjamin Tissoires 2022-01-26 1704
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2022-01-28 13:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 13:52 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-01-29 21:57 [PATCH 08/12] HID: core: for input reports, process the usages by priority list kernel test robot
2022-01-26 16:18 [PATCH 00/12] HID: fix for generic input processing Benjamin Tissoires
2022-01-26 16:18 ` [PATCH 08/12] HID: core: for input reports, process the usages by priority list Benjamin Tissoires
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=202201282135.fedFj5tc-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.