From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [mm:for-test 2/10] drivers/hid/hid-steam.c:557 steam_send_report_id() warn: check sign expansion for '__UNIQUE_ID_x__502'
Date: Mon, 09 Nov 2026 05:43:04 +0100 [thread overview]
Message-ID: <202611090501.UwoAwtQL-lkp@intel.com> (raw)
Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: David Hildenbrand <david@kernel.org>
TO: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
CC: "David Hildenbrand (Arm)" <david@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mm/linux.git for-test
head: 413ded9e05c4fe84254cee1d01aad70a428803c6
commit: 045ac46c238e70927cf9c20f61bb43437ac1c1da [2/10] Merge https://git.kernel.org/pub/scm/linux/kernel/git/mm/page_alloc.git page_alloc/for-next-fixes into for-next-fixes
:::::: branch date: 10 hours ago
:::::: commit date: 33 hours ago
config: x86_64-randconfig-2200-20261109 (https://download.01.org/0day-ci/archive/20261109/202611090501.UwoAwtQL-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
smatch: v0.5.0-9187-g5189e3fb
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202611090501.UwoAwtQL-lkp@intel.com/
smatch warnings:
drivers/hid/hid-steam.c:557 steam_send_report_id() warn: check sign expansion for '__UNIQUE_ID_x__502'
vim +/__UNIQUE_ID_x__502 +557 drivers/hid/hid-steam.c
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 516
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 517 static int steam_send_report_id(struct steam_device *steam,
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 518 u8 *cmd, int size, u8 report_id)
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 519 {
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 520 struct hid_report *r;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 521 u8 *buf;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 522 unsigned int retries = 50;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 523 int ret;
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 524 u32 len;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 525
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 526 r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[report_id];
cd11d1a6114bd4 Lee Jones 2022-07-08 527 if (!r) {
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 528 hid_err(steam->hdev, "No HID_FEATURE_REPORT present for ID %u\n", report_id);
cd11d1a6114bd4 Lee Jones 2022-07-08 529 return -EINVAL;
cd11d1a6114bd4 Lee Jones 2022-07-08 530 }
cd11d1a6114bd4 Lee Jones 2022-07-08 531
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 532 len = hid_report_len(r);
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 533 if (len < 64)
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 534 return -EINVAL;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 535
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 536 buf = hid_alloc_report_buf(r, GFP_KERNEL);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 537 if (!buf)
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 538 return -ENOMEM;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 539
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 540 /* The report ID is always consistent */
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 541 buf[0] = report_id;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 542 memcpy(buf + 1, cmd, size);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 543
de435b770cd949 Vicki Pfau 2026-07-29 544 hid_dbg(steam->hdev, "Sending report %*ph\n", size, cmd);
de435b770cd949 Vicki Pfau 2026-07-29 545
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 546 if (!(steam->quirks & STEAM_QUIRK_IBEX))
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 547 len += 1;
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 548
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 549 /*
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 550 * Sometimes the wireless controller fails with EPIPE
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 551 * when sending a feature report.
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 552 * Doing a HID_REQ_SET_REPORT and waiting for a while
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 553 * seems to fix that.
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 554 */
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 555 do {
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 556 ret = hid_hw_raw_request(steam->hdev, report_id,
0a80b4e8ec6a6e Vicki Pfau 2026-08-11 @557 buf, max(size + 1, len),
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 558 HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 559 if (ret != -EPIPE)
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 560 break;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 561 msleep(20);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 562 } while (--retries);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 563
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 564 kfree(buf);
cfa66cba6d02ff Vicki Pfau 2026-08-11 565 /*
cfa66cba6d02ff Vicki Pfau 2026-08-11 566 * Don't log if the failure is -ENODEV, as this
cfa66cba6d02ff Vicki Pfau 2026-08-11 567 * can happen normally on disconnect.
cfa66cba6d02ff Vicki Pfau 2026-08-11 568 */
cfa66cba6d02ff Vicki Pfau 2026-08-11 569 if (ret < 0 && ret != -ENODEV)
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 570 hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__,
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 571 ret, size, cmd);
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 572 return ret;
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 573 }
c164d6abf3841f Rodrigo Rivas Costa 2018-04-16 574
:::::: The code at line 557 was first introduced by commit
:::::: 0a80b4e8ec6a6e40937c7abdf8fb2ebe6cc7c1e5 HID: steam: Initial 2026 Steam Controller support
:::::: TO: Vicki Pfau <vi@endrift.com>
:::::: CC: Jiri Kosina <jkosina@suse.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-09 4:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202611090501.UwoAwtQL-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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