From: kernel test robot <lkp@intel.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Petr Mladek <pmladek@suse.com>
Subject: [linux-next:master 3401/4499] lib/test_scanf.c:247:9: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
Date: Sun, 23 May 2021 05:30:46 +0800 [thread overview]
Message-ID: <202105230539.ayZKgzxy-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5089 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8dca2cd055ffb78b37f52f0bf0bd20c249619c4d
commit: 50f530e176eac808e64416732e54c0686ce2c39b [3401/4499] lib: test_scanf: Add tests for sscanf number conversion
config: m68k-randconfig-s031-20210522 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=50f530e176eac808e64416732e54c0686ce2c39b
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 50f530e176eac808e64416732e54c0686ce2c39b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> lib/test_scanf.c:247:9: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
lib/test_scanf.c:250:9: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
lib/test_scanf.c:253:9: sparse: sparse: cast truncates bits from constant value (ffff0001 becomes 1)
>> lib/test_scanf.c:256:9: sparse: sparse: cast truncates bits from constant value (ffffff01 becomes 1)
lib/test_scanf.c:259:9: sparse: sparse: cast truncates bits from constant value (ffffff01 becomes 1)
lib/test_scanf.c:262:9: sparse: sparse: cast truncates bits from constant value (ffffff01 becomes 1)
lib/test_scanf.c: note: in included file (through include/linux/random.h):
include/linux/prandom.h:114:45: sparse: sparse: cast truncates bits from constant value (4f2e5357408c3c09 becomes 408c3c09)
vim +247 lib/test_scanf.c
217
218 static void __init numbers_simple(void)
219 {
220 simple_numbers_loop(unsigned long long, "%llu", "llu", check_ull);
221 simple_numbers_loop(long long, "%lld", "lld", check_ll);
222 simple_numbers_loop(long long, "%lld", "lli", check_ll);
223 simple_numbers_loop(unsigned long long, "%llx", "llx", check_ull);
224 simple_numbers_loop(long long, "%llx", "llx", check_ll);
225 simple_numbers_loop(long long, "0x%llx", "lli", check_ll);
226 simple_numbers_loop(unsigned long long, "0x%llx", "llx", check_ull);
227 simple_numbers_loop(long long, "0x%llx", "llx", check_ll);
228
229 simple_numbers_loop(unsigned long, "%lu", "lu", check_ulong);
230 simple_numbers_loop(long, "%ld", "ld", check_long);
231 simple_numbers_loop(long, "%ld", "li", check_long);
232 simple_numbers_loop(unsigned long, "%lx", "lx", check_ulong);
233 simple_numbers_loop(long, "%lx", "lx", check_long);
234 simple_numbers_loop(long, "0x%lx", "li", check_long);
235 simple_numbers_loop(unsigned long, "0x%lx", "lx", check_ulong);
236 simple_numbers_loop(long, "0x%lx", "lx", check_long);
237
238 simple_numbers_loop(unsigned int, "%u", "u", check_uint);
239 simple_numbers_loop(int, "%d", "d", check_int);
240 simple_numbers_loop(int, "%d", "i", check_int);
241 simple_numbers_loop(unsigned int, "%x", "x", check_uint);
242 simple_numbers_loop(int, "%x", "x", check_int);
243 simple_numbers_loop(int, "0x%x", "i", check_int);
244 simple_numbers_loop(unsigned int, "0x%x", "x", check_uint);
245 simple_numbers_loop(int, "0x%x", "x", check_int);
246
> 247 simple_numbers_loop(unsigned short, "%hu", "hu", check_ushort);
248 simple_numbers_loop(short, "%hd", "hd", check_short);
249 simple_numbers_loop(short, "%hd", "hi", check_short);
250 simple_numbers_loop(unsigned short, "%hx", "hx", check_ushort);
251 simple_numbers_loop(short, "%hx", "hx", check_short);
252 simple_numbers_loop(short, "0x%hx", "hi", check_short);
253 simple_numbers_loop(unsigned short, "0x%hx", "hx", check_ushort);
254 simple_numbers_loop(short, "0x%hx", "hx", check_short);
255
> 256 simple_numbers_loop(unsigned char, "%hhu", "hhu", check_uchar);
257 simple_numbers_loop(signed char, "%hhd", "hhd", check_char);
258 simple_numbers_loop(signed char, "%hhd", "hhi", check_char);
259 simple_numbers_loop(unsigned char, "%hhx", "hhx", check_uchar);
260 simple_numbers_loop(signed char, "%hhx", "hhx", check_char);
261 simple_numbers_loop(signed char, "0x%hhx", "hhi", check_char);
262 simple_numbers_loop(unsigned char, "0x%hhx", "hhx", check_uchar);
263 simple_numbers_loop(signed char, "0x%hhx", "hhx", check_char);
264 }
265
---
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: 29129 bytes --]
reply other threads:[~2021-05-22 21:31 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=202105230539.ayZKgzxy-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=pmladek@suse.com \
--cc=rf@opensource.cirrus.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