From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: lib/kunit/test.c:857:34: sparse: sparse: unsigned value that used to be signed checked against zero?
Date: Sat, 11 Apr 2026 05:17:37 +0800 [thread overview]
Message-ID: <202604110554.fnUWTIxa-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence static check warning: lib/kunit/test.c:857:34: sparse: sparse: unsigned value that used to be signed checked against zero?"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
CC: Daniel Gomez <da.gomez@samsung.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7c6c4ed80b874f721bc7c2c937e098c56e37d2f0
commit: 768da2eae8662ca51102794c32d37c17410acbf5 kunit: test: Drop CONFIG_MODULE ifdeffery
date: 8 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 8 months ago
config: m68k-randconfig-r112-20260410 (https://download.01.org/0day-ci/archive/20260411/202604110554.fnUWTIxa-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260411/202604110554.fnUWTIxa-lkp@intel.com/reproduce)
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
| Fixes: 768da2eae866 ("kunit: test: Drop CONFIG_MODULE ifdeffery")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202604110554.fnUWTIxa-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> lib/kunit/test.c:857:34: sparse: sparse: unsigned value that used to be signed checked against zero?
lib/kunit/test.c:848:17: sparse: signed value source
vim +857 lib/kunit/test.c
3d6e44623841c8b Jeremy Kerr 2022-07-09 844
3d6e44623841c8b Jeremy Kerr 2022-07-09 845 static void kunit_module_exit(struct module *mod)
3d6e44623841c8b Jeremy Kerr 2022-07-09 846 {
b67abaad4d25b5d Janusz Krzysztofik 2023-08-07 847 struct kunit_suite_set suite_set = {
b67abaad4d25b5d Janusz Krzysztofik 2023-08-07 848 mod->kunit_suites, mod->kunit_suites + mod->num_kunit_suites,
b67abaad4d25b5d Janusz Krzysztofik 2023-08-07 849 };
18258c60f8a74b9 Janusz Krzysztofik 2023-08-07 850 const char *action = kunit_action();
18258c60f8a74b9 Janusz Krzysztofik 2023-08-07 851
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 852 /*
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 853 * Check if the start address is a valid virtual address to detect
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 854 * if the module load sequence has failed and the suite set has not
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 855 * been initialized and filtered.
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 856 */
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 @857 if (!suite_set.start || !virt_addr_valid(suite_set.start))
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 858 return;
a1af6a2bfa0cb46 Marco Pagani 2024-01-10 859
18258c60f8a74b9 Janusz Krzysztofik 2023-08-07 860 if (!action)
18258c60f8a74b9 Janusz Krzysztofik 2023-08-07 861 __kunit_test_suites_exit(mod->kunit_suites,
18258c60f8a74b9 Janusz Krzysztofik 2023-08-07 862 mod->num_kunit_suites);
b67abaad4d25b5d Janusz Krzysztofik 2023-08-07 863
b67abaad4d25b5d Janusz Krzysztofik 2023-08-07 864 kunit_free_suite_set(suite_set);
3d6e44623841c8b Jeremy Kerr 2022-07-09 865 }
3d6e44623841c8b Jeremy Kerr 2022-07-09 866
:::::: The code at line 857 was first introduced by commit
:::::: a1af6a2bfa0cb46d70b7df5352993e750da6c79b kunit: run test suites only after module initialization completes
:::::: TO: Marco Pagani <marpagan@redhat.com>
:::::: CC: Shuah Khan <skhan@linuxfoundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-04-10 21:18 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=202604110554.fnUWTIxa-lkp@intel.com \
--to=lkp@intel.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