All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android12-5.4 1/1] include/linux/kernel.h:843:43: warning: comparison of distinct pointer types lacks a cast
Date: Mon, 30 Jun 2025 06:52:02 +0200	[thread overview]
Message-ID: <202506300640.42SWZMFf-lkp@intel.com> (raw)

tree:   https://android.googlesource.com/kernel/common android12-5.4
head:   14b655c6b6487670ee48bc9b760aefb4412b0f78
commit: f4b0174e9f18aaba59ee6ffdaf8827a7f94eb606 [1/1] tracing: Fix oob write in trace_seq_to_buffer()
config: i386-randconfig-2001-20250626 (https://download.01.org/0day-ci/archive/20250630/202506300640.42SWZMFf-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250630/202506300640.42SWZMFf-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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506300640.42SWZMFf-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/trace.c:925:6: warning: no previous prototype for 'tracing_snapshot_instance_cond' [-Wmissing-prototypes]
     925 | void tracing_snapshot_instance_cond(struct trace_array *tr, void *cond_data)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:19,
                    from arch/x86/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from include/linux/ring_buffer.h:5,
                    from kernel/trace/trace.c:15:
   kernel/trace/trace.c: In function 'tracing_splice_read_pipe':
>> include/linux/kernel.h:843:43: warning: comparison of distinct pointer types lacks a cast
     843 |                 (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
         |                                           ^~
   include/linux/kernel.h:857:18: note: in expansion of macro '__typecheck'
     857 |                 (__typecheck(x, y) && __no_side_effects(x, y))
         |                  ^~~~~~~~~~~
   include/linux/kernel.h:867:31: note: in expansion of macro '__safe_cmp'
     867 |         __builtin_choose_expr(__safe_cmp(x, y), \
         |                               ^~~~~~~~~~
   include/linux/kernel.h:876:25: note: in expansion of macro '__careful_cmp'
     876 | #define min(x, y)       __careful_cmp(x, y, <)
         |                         ^~~~~~~~~~~~~
   kernel/trace/trace.c:6334:43: note: in expansion of macro 'min'
    6334 |                                           min((size_t)trace_seq_used(&iter->seq),
         |                                           ^~~
   kernel/trace/trace.c: At top level:
   kernel/trace/trace.c:8538:21: warning: no previous prototype for 'trace_array_create' [-Wmissing-prototypes]
    8538 | struct trace_array *trace_array_create(const char *name)
         |                     ^~~~~~~~~~~~~~~~~~
   kernel/trace/trace.c:8661:5: warning: no previous prototype for 'trace_array_destroy' [-Wmissing-prototypes]
    8661 | int trace_array_destroy(struct trace_array *this_tr)
         |     ^~~~~~~~~~~~~~~~~~~


vim +843 include/linux/kernel.h

526211bc58c4b3 Ingo Molnar    2009-03-05  829  
^1da177e4c3f41 Linus Torvalds 2005-04-16  830  /*
3c8ba0d61d04ce Kees Cook      2018-03-30  831   * min()/max()/clamp() macros must accomplish three things:
3c8ba0d61d04ce Kees Cook      2018-03-30  832   *
3c8ba0d61d04ce Kees Cook      2018-03-30  833   * - avoid multiple evaluations of the arguments (so side-effects like
3c8ba0d61d04ce Kees Cook      2018-03-30  834   *   "x++" happen only once) when non-constant.
3c8ba0d61d04ce Kees Cook      2018-03-30  835   * - perform strict type-checking (to generate warnings instead of
3c8ba0d61d04ce Kees Cook      2018-03-30  836   *   nasty runtime surprises). See the "unnecessary" pointer comparison
3c8ba0d61d04ce Kees Cook      2018-03-30  837   *   in __typecheck().
3c8ba0d61d04ce Kees Cook      2018-03-30  838   * - retain result as a constant expressions when called with only
3c8ba0d61d04ce Kees Cook      2018-03-30  839   *   constant expressions (to avoid tripping VLA warnings in stack
3c8ba0d61d04ce Kees Cook      2018-03-30  840   *   allocation usage).
3c8ba0d61d04ce Kees Cook      2018-03-30  841   */
3c8ba0d61d04ce Kees Cook      2018-03-30  842  #define __typecheck(x, y) \
3c8ba0d61d04ce Kees Cook      2018-03-30 @843  		(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
3c8ba0d61d04ce Kees Cook      2018-03-30  844  

:::::: The code at line 843 was first introduced by commit
:::::: 3c8ba0d61d04ced9f8d9ff93977995a9e4e96e91 kernel.h: Retain constant expression output for max()/min()

:::::: TO: Kees Cook <keescook@chromium.org>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-06-30  4:52 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=202506300640.42SWZMFf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@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 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.