From: kernel test robot <lkp@intel.com>
To: David Laight <David.Laight@aculab.com>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
'Linus Torvalds' <torvalds@linux-foundation.org>,
'Netdev' <netdev@vger.kernel.org>,
"'dri-devel@lists.freedesktop.org'"
<dri-devel@lists.freedesktop.org>
Cc: oe-kbuild-all@lists.linux.dev, 'Jens Axboe' <axboe@kernel.dk>,
"'Matthew Wilcox (Oracle)'" <willy@infradead.org>,
'Christoph Hellwig' <hch@infradead.org>,
"'linux-btrfs@vger.kernel.org'" <linux-btrfs@vger.kernel.org>,
'Andrew Morton' <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>,
"'David S . Miller'" <davem@davemloft.net>,
'Dan Carpenter' <dan.carpenter@linaro.org>,
'Jani Nikula' <jani.nikula@linux.intel.com>
Subject: Re: [PATCH next v2 03/11] minmax: Simplify signedness check
Date: Tue, 27 Feb 2024 09:34:25 +0800 [thread overview]
Message-ID: <202402270937.9kmO5PFt-lkp@intel.com> (raw)
In-Reply-To: <8657dd5c2264456f8a005520a3b90e2b@AcuMS.aculab.com>
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linux/master mkl-can-next/testing kdave/for-next akpm-mm/mm-nonmm-unstable axboe-block/for-next linus/master v6.8-rc6 next-20240226]
[cannot apply to next-20240223 dtor-input/next dtor-input/for-linus horms-ipvs/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/David-Laight/minmax-Put-all-the-clamp-definitions-together/20240226-005902
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/8657dd5c2264456f8a005520a3b90e2b%40AcuMS.aculab.com
patch subject: [PATCH next v2 03/11] minmax: Simplify signedness check
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20240227/202402270937.9kmO5PFt-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240227/202402270937.9kmO5PFt-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/202402270937.9kmO5PFt-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:28,
from include/linux/cpumask.h:10,
from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/swait.h:7,
from include/linux/completion.h:12,
from include/linux/crypto.h:15,
from include/crypto/aead.h:13,
from include/crypto/internal/aead.h:11,
from crypto/skcipher.c:12:
crypto/skcipher.c: In function 'skcipher_get_spot':
>> include/linux/minmax.h:31:70: warning: ordered comparison of pointer with integer zero [-Wextra]
31 | (is_unsigned_type(typeof(x)) || (__is_constexpr(x) ? (x) + 0 >= 0 : 0))
| ^~
include/linux/minmax.h:39:11: note: in expansion of macro '__is_ok_unsigned'
39 | (__is_ok_unsigned(x) && __is_ok_unsigned(y)))
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:24: note: in expansion of macro '__types_ok'
49 | _Static_assert(__types_ok(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:56:17: note: in expansion of macro '__cmp_once'
56 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
| ^~~~~~~~~~
include/linux/minmax.h:70:25: note: in expansion of macro '__careful_cmp'
70 | #define max(x, y) __careful_cmp(max, x, y)
| ^~~~~~~~~~~~~
crypto/skcipher.c:83:16: note: in expansion of macro 'max'
83 | return max(start, end_page);
| ^~~
>> include/linux/minmax.h:31:70: warning: ordered comparison of pointer with integer zero [-Wextra]
31 | (is_unsigned_type(typeof(x)) || (__is_constexpr(x) ? (x) + 0 >= 0 : 0))
| ^~
include/linux/minmax.h:39:34: note: in expansion of macro '__is_ok_unsigned'
39 | (__is_ok_unsigned(x) && __is_ok_unsigned(y)))
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:24: note: in expansion of macro '__types_ok'
49 | _Static_assert(__types_ok(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:56:17: note: in expansion of macro '__cmp_once'
56 | __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
| ^~~~~~~~~~
include/linux/minmax.h:70:25: note: in expansion of macro '__careful_cmp'
70 | #define max(x, y) __careful_cmp(max, x, y)
| ^~~~~~~~~~~~~
crypto/skcipher.c:83:16: note: in expansion of macro 'max'
83 | return max(start, end_page);
| ^~~
vim +31 include/linux/minmax.h
9
10 /*
11 * min()/max()/clamp() macros must accomplish several things:
12 *
13 * - Avoid multiple evaluations of the arguments (so side-effects like
14 * "x++" happen only once) when non-constant.
15 * - Retain result as a constant expressions when called with only
16 * constant expressions (to avoid tripping VLA warnings in stack
17 * allocation usage).
18 * - Perform signed v unsigned type-checking (to generate compile
19 * errors instead of nasty runtime surprises).
20 * - Unsigned char/short are always promoted to signed int and can be
21 * compared against signed or unsigned arguments.
22 * - Unsigned arguments can be compared against non-negative signed constants.
23 * - Comparison of a signed argument against an unsigned constant fails
24 * even if the constant is below __INT_MAX__ and could be cast to int.
25 */
26 #define __typecheck(x, y) \
27 (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
28
29 /* Allow unsigned compares against non-negative signed constants. */
30 #define __is_ok_unsigned(x) \
> 31 (is_unsigned_type(typeof(x)) || (__is_constexpr(x) ? (x) + 0 >= 0 : 0))
32
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next parent reply other threads:[~2024-02-27 1:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8657dd5c2264456f8a005520a3b90e2b@AcuMS.aculab.com>
2024-02-27 1:34 ` kernel test robot [this message]
2024-02-27 9:10 ` [PATCH next v2 03/11] minmax: Simplify signedness check David Laight
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=202402270937.9kmO5PFt-lkp@intel.com \
--to=lkp@intel.com \
--cc=David.Laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@infradead.org \
--cc=jani.nikula@linux.intel.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).