From: kernel test robot <lkp@intel.com>
To: Beau Belgrave <beaub@linux.microsoft.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: kernel/trace/trace_events_user.c:392:38: sparse: sparse: Using plain integer as NULL pointer
Date: Mon, 28 Mar 2022 17:22:06 +0800 [thread overview]
Message-ID: <202203281754.okRdoDAL-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ae085d7f9365de7da27ab5c0d16b12d51ea7fca9
commit: aa3b2b4c669205200615dd8a2cc4af4f81fd0335 user_events: Add print_fmt generation support for basic types
date: 6 weeks ago
config: i386-randconfig-s001-20220328 (https://download.01.org/0day-ci/archive/20220328/202203281754.okRdoDAL-lkp@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aa3b2b4c669205200615dd8a2cc4af4f81fd0335
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout aa3b2b4c669205200615dd8a2cc4af4f81fd0335
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/acpi/apei/ drivers/gpu/drm/ kernel/trace/
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 >>)
>> kernel/trace/trace_events_user.c:392:38: sparse: sparse: Using plain integer as NULL pointer
kernel/trace/trace_events_user.c:413:40: sparse: sparse: Using plain integer as NULL pointer
kernel/trace/trace_events_user.c:858:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:858:16: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:858:16: sparse: void *
kernel/trace/trace_events_user.c:922:13: sparse: sparse: cast removes address space '__user' of expression
kernel/trace/trace_events_user.c:922:13: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __user *buf @@ got char * @@
kernel/trace/trace_events_user.c:922:13: sparse: expected void [noderef] __user *buf
kernel/trace/trace_events_user.c:922:13: sparse: got char *
kernel/trace/trace_events_user.c:938:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:938:16: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:938:16: sparse: void *
kernel/trace/trace_events_user.c:965:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/trace/trace_events_user.c:965:9: sparse: void [noderef] __rcu *
kernel/trace/trace_events_user.c:965:9: sparse: void *
vim +392 kernel/trace/trace_events_user.c
361
362 static const char *user_field_format(const char *type)
363 {
364 if (strcmp(type, "s64") == 0)
365 return "%lld";
366 if (strcmp(type, "u64") == 0)
367 return "%llu";
368 if (strcmp(type, "s32") == 0)
369 return "%d";
370 if (strcmp(type, "u32") == 0)
371 return "%u";
372 if (strcmp(type, "int") == 0)
373 return "%d";
374 if (strcmp(type, "unsigned int") == 0)
375 return "%u";
376 if (strcmp(type, "s16") == 0)
377 return "%d";
378 if (strcmp(type, "u16") == 0)
379 return "%u";
380 if (strcmp(type, "short") == 0)
381 return "%d";
382 if (strcmp(type, "unsigned short") == 0)
383 return "%u";
384 if (strcmp(type, "s8") == 0)
385 return "%d";
386 if (strcmp(type, "u8") == 0)
387 return "%u";
388 if (strcmp(type, "char") == 0)
389 return "%d";
390 if (strcmp(type, "unsigned char") == 0)
391 return "%u";
> 392 if (strstr(type, "char[") != 0)
393 return "%s";
394
395 /* Unknown, likely struct, allowed treat as 64-bit */
396 return "%llu";
397 }
398
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-03-28 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 9:22 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-15 23:27 kernel/trace/trace_events_user.c:392:38: sparse: sparse: Using plain integer as NULL pointer kernel test robot
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=202203281754.okRdoDAL-lkp@intel.com \
--to=lkp@intel.com \
--cc=beaub@linux.microsoft.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.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.