* [PATCH 4/7] minmax: Simplify signedness check
2024-07-24 14:26 [PATCH 0/7] minmax: reduce compilation time David Laight
@ 2024-07-24 14:30 ` David Laight
2024-07-24 16:48 ` Arnd Bergmann
2024-07-25 13:24 ` kernel test robot
0 siblings, 2 replies; 12+ messages in thread
From: David Laight @ 2024-07-24 14:30 UTC (permalink / raw)
To: 'linux-kernel@vger.kernel.org', 'Linus Torvalds'
Cc: 'Matthew Wilcox (Oracle)', 'Christoph Hellwig',
'Andrew Morton', 'Andy Shevchenko',
'Dan Carpenter', 'Arnd Bergmann',
'Jason@zx2c4.com', 'hch@infradead.org',
'pedro.falcato@gmail.com', 'Mateusz Guzik',
'linux-mm@kvack.org'
It is enough to check that both 'x' and 'y' are valid for either
a signed compare or an unsigned compare.
For unsigned they must be an unsigned type or a positive constant.
For signed they must be signed after unsigned char/short are promoted.
Order the expressions to avoid warnings about comparisons that are
always true.
Signed-off-by: David Laight <david.laight@aculab.com>
---
include/linux/minmax.h | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/include/linux/minmax.h b/include/linux/minmax.h
index 900eec7a28e5..d3ac65c1add7 100644
--- a/include/linux/minmax.h
+++ b/include/linux/minmax.h
@@ -8,7 +8,7 @@
#include <linux/types.h>
/*
- * min()/max()/clamp() macros must accomplish three things:
+ * min()/max()/clamp() macros must accomplish several things:
*
* - Avoid multiple evaluations of the arguments (so side-effects like
* "x++" happen only once) when non-constant.
@@ -26,19 +26,17 @@
#define __typecheck(x, y) \
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
-/* is_signed_type() isn't a constexpr for pointer types */
-#define __is_signed(x) \
- __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
- is_signed_type(typeof(x)), 0)
+/* Allow unsigned compares against non-negative signed constants. */
+#define __is_ok_unsigned(x) \
+ ((is_unsigned_type(typeof(x)) ? 0 : __if_constexpr(x, (x) + 0, -1)) >= 0)
-/* True for a non-negative signed int constant */
-#define __is_noneg_int(x) \
- (__builtin_choose_expr(__is_constexpr(x) && __is_signed(x), x, -1) >= 0)
+/* Check for signed after promoting unsigned char/short to int */
+#define __is_ok_signed(x) is_signed_type(typeof((x) + 0))
-#define __types_ok(x, y) \
- (__is_signed(x) == __is_signed(y) || \
- __is_signed((x) + 0) == __is_signed((y) + 0) || \
- __is_noneg_int(x) || __is_noneg_int(y))
+/* Allow if both x and y are valid for either signed or unsigned compares. */
+#define __types_ok(x, y) \
+ ((__is_ok_signed(x) && __is_ok_signed(y)) || \
+ (__is_ok_unsigned(x) && __is_ok_unsigned(y)))
#define __cmp_op_min <
#define __cmp_op_max >
--
2.17.1
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-24 14:30 ` [PATCH 4/7] minmax: Simplify signedness check David Laight
@ 2024-07-24 16:48 ` Arnd Bergmann
2024-07-24 20:02 ` Linus Torvalds
2024-07-25 13:24 ` kernel test robot
1 sibling, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2024-07-24 16:48 UTC (permalink / raw)
To: David Laight, 'linux-kernel@vger.kernel.org',
Linus Torvalds
Cc: Matthew Wilcox, Christoph Hellwig, Andrew Morton, Andy Shevchenko,
Dan Carpenter, Jason A . Donenfeld,
'pedro.falcato@gmail.com', Mateusz Guzik,
'linux-mm@kvack.org'
On Wed, Jul 24, 2024, at 16:30, David Laight wrote:
> It is enough to check that both 'x' and 'y' are valid for either
> a signed compare or an unsigned compare.
> For unsigned they must be an unsigned type or a positive constant.
> For signed they must be signed after unsigned char/short are promoted.
>
> Order the expressions to avoid warnings about comparisons that are
> always true.
>
> Signed-off-by: David Laight <david.laight@aculab.com>
This patch gives me a 10x speedup on compiling arch/x86/xen/setup.c,
taking it from 15 seconds to 1.5 seconds for a defconfig+CONFIG_XEN
build.
>+/* Allow unsigned compares against non-negative signed constants. */
>+#define __is_ok_unsigned(x) \
>+ ((is_unsigned_type(typeof(x)) ? 0 : __if_constexpr(x, (x) + 0, -1)) >= 0)
I don't understand why this return '0' for unsigned types,
shouldn't this be
((is_unsigned_type(typeof(x)) ? 1 : __if_constexpr(x, (x) + 0, -1)) >= 0)
?
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-24 16:48 ` Arnd Bergmann
@ 2024-07-24 20:02 ` Linus Torvalds
2024-07-25 9:00 ` David Laight
0 siblings, 1 reply; 12+ messages in thread
From: Linus Torvalds @ 2024-07-24 20:02 UTC (permalink / raw)
To: Arnd Bergmann
Cc: David Laight, linux-kernel@vger.kernel.org, Matthew Wilcox,
Christoph Hellwig, Andrew Morton, Andy Shevchenko, Dan Carpenter,
Jason A . Donenfeld, pedro.falcato@gmail.com, Mateusz Guzik,
linux-mm@kvack.org
On Wed, 24 Jul 2024 at 09:49, Arnd Bergmann <arnd@kernel.org> wrote:
>
> I don't understand why this return '0' for unsigned types,
> shouldn't this be
>
> ((is_unsigned_type(typeof(x)) ? 1 : __if_constexpr(x, (x) + 0, -1)) >= 0)
Yes, that looks more logical.
Plus why do that "__if_constexpr(x, (x) + 0, -1)) >= 0)" when it would
appear to be more logical to move the comparison inside, ie
__if_constexpr(x, (x) >= 0, 0)
but I also don't see why that "+ 0" existed in the original. So
there's presumably something I'm missing.
I do get the feeling that the problem came from us being much too
clever with out min/max macros, and now this series is doubling down
instead of saying "it wasn't really worth it".
Linus
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH 4/7] minmax: Simplify signedness check
2024-07-24 20:02 ` Linus Torvalds
@ 2024-07-25 9:00 ` David Laight
2024-07-25 17:02 ` Linus Torvalds
0 siblings, 1 reply; 12+ messages in thread
From: David Laight @ 2024-07-25 9:00 UTC (permalink / raw)
To: 'Linus Torvalds', Arnd Bergmann
Cc: linux-kernel@vger.kernel.org, Matthew Wilcox, Christoph Hellwig,
Andrew Morton, Andy Shevchenko, Dan Carpenter,
Jason A . Donenfeld, pedro.falcato@gmail.com, Mateusz Guzik,
linux-mm@kvack.org
From: Linus Torvalds
> Sent: 24 July 2024 21:03
>
> On Wed, 24 Jul 2024 at 09:49, Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > I don't understand why this return '0' for unsigned types,
> > shouldn't this be
> >
> > ((is_unsigned_type(typeof(x)) ? 1 : __if_constexpr(x, (x) + 0, -1)) >= 0)
>
> Yes, that looks more logical.
The condition is '>= 0' so it doesn't matter if it is '1' or '0'.
> Plus why do that "__if_constexpr(x, (x) + 0, -1)) >= 0)" when it would
> appear to be more logical to move the comparison inside, ie
>
> __if_constexpr(x, (x) >= 0, 0)
That gives a 'comparison of unsigned type against 0 is always true' warning.
(The compiler generates that for code in the unused branches of both
__builtin_choose_expr() and _Generic().)
Moving the comparison to the outer level stops all such compiler warnings.
> but I also don't see why that "+ 0" existed in the original. So
> there's presumably something I'm missing.
IIRC it was there to convert a 'bool' to 'int'.
Somewhere the is a max(bool,bool) that could just be |.
If may not be needed now the expansion is '(cond ? 0 : bool) >= 0'
since the 'bool' picks up an (int) cast from the result of ?:.
David
> I do get the feeling that the problem came from us being much too
> clever with out min/max macros, and now this series is doubling down
> instead of saying "it wasn't really worth it".
>
> Linus
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-24 14:30 ` [PATCH 4/7] minmax: Simplify signedness check David Laight
2024-07-24 16:48 ` Arnd Bergmann
@ 2024-07-25 13:24 ` kernel test robot
2024-07-25 16:39 ` David Laight
1 sibling, 1 reply; 12+ messages in thread
From: kernel test robot @ 2024-07-25 13:24 UTC (permalink / raw)
To: David Laight, 'linux-kernel@vger.kernel.org',
'Linus Torvalds'
Cc: llvm, oe-kbuild-all, 'Matthew Wilcox (Oracle)',
'Christoph Hellwig', 'Andrew Morton',
Linux Memory Management List, 'Andy Shevchenko',
'Dan Carpenter', 'Arnd Bergmann',
'Jason@zx2c4.com', 'pedro.falcato@gmail.com',
'Mateusz Guzik'
Hi David,
kernel test robot noticed the following build errors:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v6.10 next-20240725]
[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/20240724-224832
base: linux/master
patch link: https://lore.kernel.org/r/03601661326c4efba4e618ead15fa0e2%40AcuMS.aculab.com
patch subject: [PATCH 4/7] minmax: Simplify signedness check
config: mips-loongson1b_defconfig (https://download.01.org/0day-ci/archive/20240725/202407252100.fDFchC5O-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240725/202407252100.fDFchC5O-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/202407252100.fDFchC5O-lkp@intel.com/
All errors (new ones prefixed by >>):
>> crypto/skcipher.c:83:9: error: static assertion expression is not an integral constant expression
return max(start, end_page);
^~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:70:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(max, x, y)
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:56:3: note: expanded from macro '__careful_cmp'
__cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:49:17: note: expanded from macro '__cmp_once'
_Static_assert(__types_ok(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:38:2: note: expanded from macro '__types_ok'
((__is_ok_signed(x) && __is_ok_signed(y)) || \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:83:9: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
include/linux/minmax.h:70:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(max, x, y)
^
include/linux/minmax.h:56:3: note: expanded from macro '__careful_cmp'
__cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
^
include/linux/minmax.h:49:17: note: expanded from macro '__cmp_once'
_Static_assert(__types_ok(x, y), \
^
include/linux/minmax.h:38:4: note: expanded from macro '__types_ok'
((__is_ok_signed(x) && __is_ok_signed(y)) || \
^
include/linux/minmax.h:34:27: note: expanded from macro '__is_ok_signed'
#define __is_ok_signed(x) is_signed_type(typeof((x) + 0))
^
include/linux/compiler.h:273:32: note: expanded from macro 'is_signed_type'
#define is_signed_type(type) (((type)(-1)) < (__force type)1)
^
1 error generated.
--
>> lib/lzo/lzo1x_compress.c:53:33: error: static assertion expression is not an integral constant expression
const unsigned char *limit = min(ip_end, ip + MAX_ZERO_RUN_LENGTH + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:63:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(min, x, y)
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:56:3: note: expanded from macro '__careful_cmp'
__cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:49:17: note: expanded from macro '__cmp_once'
_Static_assert(__types_ok(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:38:2: note: expanded from macro '__types_ok'
((__is_ok_signed(x) && __is_ok_signed(y)) || \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/lzo/lzo1x_compress.c:53:33: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
include/linux/minmax.h:63:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(min, x, y)
^
include/linux/minmax.h:56:3: note: expanded from macro '__careful_cmp'
__cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
^
include/linux/minmax.h:49:17: note: expanded from macro '__cmp_once'
_Static_assert(__types_ok(x, y), \
^
include/linux/minmax.h:38:4: note: expanded from macro '__types_ok'
((__is_ok_signed(x) && __is_ok_signed(y)) || \
^
include/linux/minmax.h:34:27: note: expanded from macro '__is_ok_signed'
#define __is_ok_signed(x) is_signed_type(typeof((x) + 0))
^
include/linux/compiler.h:273:32: note: expanded from macro 'is_signed_type'
#define is_signed_type(type) (((type)(-1)) < (__force type)1)
^
1 error generated.
vim +83 crypto/skcipher.c
b286d8b1a690667 Herbert Xu 2016-11-22 75
b286d8b1a690667 Herbert Xu 2016-11-22 76 /* Get a spot of the specified length that does not straddle a page.
b286d8b1a690667 Herbert Xu 2016-11-22 77 * The caller needs to ensure that there is enough space for this operation.
b286d8b1a690667 Herbert Xu 2016-11-22 78 */
b286d8b1a690667 Herbert Xu 2016-11-22 79 static inline u8 *skcipher_get_spot(u8 *start, unsigned int len)
b286d8b1a690667 Herbert Xu 2016-11-22 80 {
b286d8b1a690667 Herbert Xu 2016-11-22 81 u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK);
b286d8b1a690667 Herbert Xu 2016-11-22 82
b286d8b1a690667 Herbert Xu 2016-11-22 @83 return max(start, end_page);
b286d8b1a690667 Herbert Xu 2016-11-22 84 }
b286d8b1a690667 Herbert Xu 2016-11-22 85
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH 4/7] minmax: Simplify signedness check
2024-07-25 13:24 ` kernel test robot
@ 2024-07-25 16:39 ` David Laight
0 siblings, 0 replies; 12+ messages in thread
From: David Laight @ 2024-07-25 16:39 UTC (permalink / raw)
To: 'kernel test robot',
'linux-kernel@vger.kernel.org', 'Linus Torvalds'
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
'Matthew Wilcox (Oracle)', 'Christoph Hellwig',
'Andrew Morton', Linux Memory Management List,
'Andy Shevchenko', 'Dan Carpenter',
'Arnd Bergmann', 'Jason@zx2c4.com',
'pedro.falcato@gmail.com', 'Mateusz Guzik'
From: kernel test robot <lkp@intel.com>
> Sent: 25 July 2024 14:24
>
> Hi David,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on linux/master]
> [also build test ERROR on linus/master v6.10 next-20240725]
> [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/20240724-224832
> base: linux/master
> patch link: https://lore.kernel.org/r/03601661326c4efba4e618ead15fa0e2%40AcuMS.aculab.com
> patch subject: [PATCH 4/7] minmax: Simplify signedness check
> config: mips-loongson1b_defconfig (https://download.01.org/0day-
> ci/archive/20240725/202407252100.fDFchC5O-lkp@intel.com/config)
> compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project
> 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
> reproduce (this is a W=1 build): (https://download.01.org/0day-
> ci/archive/20240725/202407252100.fDFchC5O-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/202407252100.fDFchC5O-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
...
> b286d8b1a690667 Herbert Xu 2016-11-22 75
> b286d8b1a690667 Herbert Xu 2016-11-22 76 /* Get a spot of the specified length that does not straddle a page.
> b286d8b1a690667 Herbert Xu 2016-11-22 77 * The caller needs to ensure that there is enough space for this operation.
> b286d8b1a690667 Herbert Xu 2016-11-22 78 */
> b286d8b1a690667 Herbert Xu 2016-11-22 79 static inline u8 *skcipher_get_spot(u8 *start, unsigned int len)
> b286d8b1a690667 Herbert Xu 2016-11-22 80 {
> b286d8b1a690667 Herbert Xu 2016-11-22 81 u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK);
> b286d8b1a690667 Herbert Xu 2016-11-22 82
> b286d8b1a690667 Herbert Xu 2016-11-22 @83 return max(start, end_page);
> b286d8b1a690667 Herbert Xu 2016-11-22 84 }
> b286d8b1a690667 Herbert Xu 2016-11-22 85
I thought this version supported that :-(
Certainly I've hit and fixed this before.
Using min/max() on pointers just makes it all more horrid.
The problem is that is_signed_type() isn't 'constant enough' for pointers.
Supporting pointers may require yet another (bloating) _is_constexpr() call.
Or add a simpler min_ptr() that includes a 'pointer' check.
But this might only be reported by clang with W=1.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-25 9:00 ` David Laight
@ 2024-07-25 17:02 ` Linus Torvalds
2024-07-26 9:43 ` Lorenzo Stoakes
0 siblings, 1 reply; 12+ messages in thread
From: Linus Torvalds @ 2024-07-25 17:02 UTC (permalink / raw)
To: David Laight
Cc: Arnd Bergmann, linux-kernel@vger.kernel.org, Matthew Wilcox,
Christoph Hellwig, Andrew Morton, Andy Shevchenko, Dan Carpenter,
Jason A . Donenfeld, pedro.falcato@gmail.com, Mateusz Guzik,
linux-mm@kvack.org
On Thu, 25 Jul 2024 at 02:01, David Laight <David.Laight@aculab.com> wrote:
>
> The condition is '>= 0' so it doesn't matter if it is '1' or '0'.
Yes, but that's because the whole conditional is so inexplicably complex.
But the explanation is:
> That gives a 'comparison of unsigned type against 0 is always true' warning.
> (The compiler generates that for code in the unused branches of both
> __builtin_choose_expr() and _Generic().)
> Moving the comparison to the outer level stops all such compiler warnings.
Christ. This whole series is a nightmare of "add complexity to deal
with stupid issues".
But the kernel test robot clearly found even more issues.
I think we need to just go back to the old code. It was stupid and
limited and caused us to have to be more careful about types than was
strictly necessary.
But it was also about a million times simpler, and didn't cause build
time regressions.
Linus
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
@ 2024-07-25 19:28 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-07-25 19:28 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: arch/arm64/kvm/hyp/nvhe/page_alloc.c:121:21: sparse: sparse: bad integer constant expression"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <03601661326c4efba4e618ead15fa0e2@AcuMS.aculab.com>
References: <03601661326c4efba4e618ead15fa0e2@AcuMS.aculab.com>
TO: David Laight <David.Laight@ACULAB.COM>
TO: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
TO: "'Linus Torvalds'" <torvalds@linuxfoundation.org>
CC: "'Matthew Wilcox (Oracle)'" <willy@infradead.org>
CC: "'Christoph Hellwig'" <hch@infradead.org>
CC: "'Andrew Morton'" <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: "'Andy Shevchenko'" <andriy.shevchenko@linux.intel.com>
CC: "'Dan Carpenter'" <dan.carpenter@linaro.org>
CC: "'Arnd Bergmann'" <arnd@kernel.org>
CC: "'Jason@zx2c4.com'" <Jason@zx2c4.com>
CC: "'pedro.falcato@gmail.com'" <pedro.falcato@gmail.com>
CC: "'Mateusz Guzik'" <mjguzik@gmail.com>
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v6.10 next-20240725]
[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/20240724-224832
base: linux/master
patch link: https://lore.kernel.org/r/03601661326c4efba4e618ead15fa0e2%40AcuMS.aculab.com
patch subject: [PATCH 4/7] minmax: Simplify signedness check
:::::: branch date: 29 hours ago
:::::: commit date: 29 hours ago
config: arm64-randconfig-r132-20240725 (https://download.01.org/0day-ci/archive/20240726/202407260319.rmgaXdIl-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20240726/202407260319.rmgaXdIl-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/r/202407260319.rmgaXdIl-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/arm64/kvm/hyp/nvhe/page_alloc.c:121:21: sparse: sparse: bad integer constant expression
>> arch/arm64/kvm/hyp/nvhe/page_alloc.c:121:21: sparse: sparse: static assertion failed: "min(p, buddy) signedness error, fix types or consider umin() before min_t()"
vim +121 arch/arm64/kvm/hyp/nvhe/page_alloc.c
914cde58a03cc5 Quentin Perret 2021-06-08 92
8e17c66249e9ea Quentin Perret 2021-03-19 93 static void __hyp_attach_page(struct hyp_pool *pool,
8e17c66249e9ea Quentin Perret 2021-03-19 94 struct hyp_page *p)
8e17c66249e9ea Quentin Perret 2021-03-19 95 {
72a5bc0f153ce8 Quentin Perret 2022-11-10 96 phys_addr_t phys = hyp_page_to_phys(p);
87ec0606733e1a Quentin Perret 2021-06-08 97 unsigned short order = p->order;
8e17c66249e9ea Quentin Perret 2021-03-19 98 struct hyp_page *buddy;
8e17c66249e9ea Quentin Perret 2021-03-19 99
8e17c66249e9ea Quentin Perret 2021-03-19 100 memset(hyp_page_to_virt(p), 0, PAGE_SIZE << p->order);
8e17c66249e9ea Quentin Perret 2021-03-19 101
72a5bc0f153ce8 Quentin Perret 2022-11-10 102 /* Skip coalescing for 'external' pages being freed into the pool. */
72a5bc0f153ce8 Quentin Perret 2022-11-10 103 if (phys < pool->range_start || phys >= pool->range_end)
72a5bc0f153ce8 Quentin Perret 2022-11-10 104 goto insert;
72a5bc0f153ce8 Quentin Perret 2022-11-10 105
8e17c66249e9ea Quentin Perret 2021-03-19 106 /*
8e17c66249e9ea Quentin Perret 2021-03-19 107 * Only the first struct hyp_page of a high-order page (otherwise known
8e17c66249e9ea Quentin Perret 2021-03-19 108 * as the 'head') should have p->order set. The non-head pages should
8e17c66249e9ea Quentin Perret 2021-03-19 109 * have p->order = HYP_NO_ORDER. Here @p may no longer be the head
21ea457842759a Julia Lawall 2022-03-18 110 * after coalescing, so make sure to mark it HYP_NO_ORDER proactively.
8e17c66249e9ea Quentin Perret 2021-03-19 111 */
8e17c66249e9ea Quentin Perret 2021-03-19 112 p->order = HYP_NO_ORDER;
23baf831a32c04 Kirill A. Shutemov 2023-03-15 113 for (; (order + 1) <= pool->max_order; order++) {
8e17c66249e9ea Quentin Perret 2021-03-19 114 buddy = __find_buddy_avail(pool, p, order);
8e17c66249e9ea Quentin Perret 2021-03-19 115 if (!buddy)
8e17c66249e9ea Quentin Perret 2021-03-19 116 break;
8e17c66249e9ea Quentin Perret 2021-03-19 117
21ea457842759a Julia Lawall 2022-03-18 118 /* Take the buddy out of its list, and coalesce with @p */
914cde58a03cc5 Quentin Perret 2021-06-08 119 page_remove_from_list(buddy);
8e17c66249e9ea Quentin Perret 2021-03-19 120 buddy->order = HYP_NO_ORDER;
8e17c66249e9ea Quentin Perret 2021-03-19 @121 p = min(p, buddy);
8e17c66249e9ea Quentin Perret 2021-03-19 122 }
8e17c66249e9ea Quentin Perret 2021-03-19 123
72a5bc0f153ce8 Quentin Perret 2022-11-10 124 insert:
8e17c66249e9ea Quentin Perret 2021-03-19 125 /* Mark the new head, and insert it */
8e17c66249e9ea Quentin Perret 2021-03-19 126 p->order = order;
914cde58a03cc5 Quentin Perret 2021-06-08 127 page_add_to_list(p, &pool->free_area[order]);
8e17c66249e9ea Quentin Perret 2021-03-19 128 }
8e17c66249e9ea Quentin Perret 2021-03-19 129
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
@ 2024-07-25 20:02 kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2024-07-25 20:02 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: crypto/skcipher.c:83:16: sparse: sparse: bad integer constant expression"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <03601661326c4efba4e618ead15fa0e2@AcuMS.aculab.com>
References: <03601661326c4efba4e618ead15fa0e2@AcuMS.aculab.com>
TO: David Laight <David.Laight@ACULAB.COM>
TO: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
TO: "'Linus Torvalds'" <torvalds@linuxfoundation.org>
CC: "'Matthew Wilcox (Oracle)'" <willy@infradead.org>
CC: "'Christoph Hellwig'" <hch@infradead.org>
CC: "'Andrew Morton'" <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: "'Andy Shevchenko'" <andriy.shevchenko@linux.intel.com>
CC: "'Dan Carpenter'" <dan.carpenter@linaro.org>
CC: "'Arnd Bergmann'" <arnd@kernel.org>
CC: "'Jason@zx2c4.com'" <Jason@zx2c4.com>
CC: "'pedro.falcato@gmail.com'" <pedro.falcato@gmail.com>
CC: "'Mateusz Guzik'" <mjguzik@gmail.com>
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v6.10 next-20240725]
[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/20240724-224832
base: linux/master
patch link: https://lore.kernel.org/r/03601661326c4efba4e618ead15fa0e2%40AcuMS.aculab.com
patch subject: [PATCH 4/7] minmax: Simplify signedness check
:::::: branch date: 29 hours ago
:::::: commit date: 29 hours ago
config: x86_64-randconfig-121-20240725 (https://download.01.org/0day-ci/archive/20240726/202407260322.dNzOOE6d-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240726/202407260322.dNzOOE6d-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/r/202407260322.dNzOOE6d-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> crypto/skcipher.c:83:16: sparse: sparse: bad integer constant expression
>> crypto/skcipher.c:83:16: sparse: sparse: static assertion failed: "max(start, end_page) signedness error, fix types or consider umax() before max_t()"
--
>> mm/percpu.c:3098:24: sparse: sparse: bad integer constant expression
>> mm/percpu.c:3098:24: sparse: sparse: static assertion failed: "min(ptr, base) signedness error, fix types or consider umin() before min_t()"
--
>> drivers/gpu/drm/drm_modes.c:2475:29: sparse: sparse: bad integer constant expression
>> drivers/gpu/drm/drm_modes.c:2475:29: sparse: sparse: static assertion failed: "max(bpp_end_ptr, refresh_end_ptr) signedness error, fix types or consider umax() before max_t()"
--
>> net/ceph/osdmap.c:1773:54: sparse: sparse: bad integer constant expression
>> net/ceph/osdmap.c:1773:54: sparse: sparse: static assertion failed: "min(*p + len, end) signedness error, fix types or consider umin() before min_t()"
net/ceph/osdmap.c:2000:46: sparse: sparse: bad integer constant expression
net/ceph/osdmap.c:2000:46: sparse: sparse: static assertion failed: "min(*p+len, end) signedness error, fix types or consider umin() before min_t()"
net/ceph/osdmap.c:2007:57: sparse: sparse: bad integer constant expression
net/ceph/osdmap.c:2007:57: sparse: sparse: static assertion failed: "min(*p + len, end) signedness error, fix types or consider umin() before min_t()"
--
fs/bcachefs/backpointers.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/backpointers.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 28617 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.backpointers.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"backpointers"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/backpointers.c
--
fs/bcachefs/alloc_background.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/alloc_background.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 28881 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.alloc_background.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"alloc_background"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/alloc_background.c
--
fs/bcachefs/bkey_sort.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/bkey_sort.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 29305 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.bkey_sort.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"bkey_sort"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/bkey_sort.c
--
fs/bcachefs/btree_node_scan.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_node_scan.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 29986 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_node_scan.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_node_scan"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_node_scan.c
--
fs/bcachefs/btree_gc.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_gc.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 30092 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_gc.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_gc"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_gc.c
--
fs/bcachefs/btree_io.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_io.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 30290 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_io.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_io"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_io.c
--
fs/bcachefs/btree_trans_commit.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_trans_commit.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 30315 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_trans_commit.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_trans_commit"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_trans_commit.c
--
fs/bcachefs/btree_write_buffer.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_write_buffer.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 30821 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_write_buffer.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_write_buffer"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_write_buffer.c
--
fs/bcachefs/btree_update_interior.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/btree_update_interior.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 31082 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.btree_update_interior.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"btree_update_interior"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/btree_update_interior.c
--
fs/bcachefs/debug.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/debug.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 31969 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.debug.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"debug"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/debug.c
--
fs/bcachefs/extent_update.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/extent_update.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 32636 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.extent_update.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"extent_update"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/extent_update.c
--
fs/bcachefs/journal_io.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/journal_io.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 34455 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.journal_io.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"journal_io"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/journal_io.c
--
fs/bcachefs/migrate.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/migrate.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 34697 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.migrate.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"migrate"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/migrate.c
--
>> fs/bcachefs/printbuf.c:103:29: sparse: sparse: bad integer constant expression
>> fs/bcachefs/printbuf.c:103:29: sparse: sparse: static assertion failed: "min(n, (char *) memscan(p, '\r', len)) signedness error, fix types or consider umin() before min_t()"
fs/bcachefs/printbuf.c:104:29: sparse: sparse: bad integer constant expression
>> fs/bcachefs/printbuf.c:104:29: sparse: sparse: static assertion failed: "min(n, (char *) memscan(p, '\t', len)) signedness error, fix types or consider umin() before min_t()"
--
fs/bcachefs/move.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/move.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 35027 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.move.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"move"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/move.c
--
fs/bcachefs/recovery.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/recovery.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 35483 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.recovery.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"recovery"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/recovery.c
--
fs/bcachefs/sb-clean.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/sb-clean.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 35855 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.sb-clean.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"sb_clean"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/sb-clean.c
--
fs/bcachefs/sysfs.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/sysfs.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 36978 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.sysfs.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"sysfs"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/sysfs.c
--
fs/bcachefs/super.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/super.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 37065 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.super.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"super"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/super.c
--
fs/bcachefs/trace.c: note: in included file:
fs/bcachefs/bcachefs.h:993:9: sparse: sparse: array of flexible structures
fs/bcachefs/trace.c: note: in included file:
>> fs/bcachefs/btree_update_interior.h:278:40: sparse: sparse: bad integer constant expression
*** buffer overflow detected ***: terminated
/bin/bash: line 1: 37416 Aborted sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited -fmax-warnings=unlimited -D__x86_64__ --arch=x86_64 -mlittle-endian -m64 -Wp,-MMD,fs/bcachefs/.trace.o.d -nostdinc -Iarch/x86/include -I./arch/x86/include/generated -Iinclude -I./include -Iarch/x86/include/uapi -I./arch/x86/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -Wundef -DKBUILD_EXTRA_WARN1 -std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=k8 -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern -fno-jump-tables -fno-delete-null-pointer-checks -Os --param=allow-store-data-races=0 -fstack-protector-strong -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Werror=strict-prototypes -Wno-format-security -Wno-trigraphs -Wno-frame-address -Wmissing-declarations -Wmissing-prototypes -Wframe-larger-than=8192 -Wno-main -Wvla -Wno-pointer-sign -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wextra -Wunused -Wmissing-format-attribute -Wmissing-include-dirs -Wunused-const-variable -Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g -fno-var-tracking -femit-struct-debug-baseonly -fplugin=./scripts/gcc-plugins/structleak_plugin.so -fplugin=./scripts/gcc-plugins/stackleak_plugin.so -DSTRUCTLEAK_PLUGIN -DSTACKLEAK_PLUGIN -fplugin-arg-stackleak_plugin-track-min-size=100 -fplugin-arg-stackleak_plugin-arch=x86 -Wno-missing-prototypes -Wno-missing-declarations -Wno-override-init -Wtautological-compare -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef -Wformat-overflow -Wformat-truncation -Wrestrict -Wno-psabi -Ifs/bcachefs -Ifs/bcachefs -DKBUILD_MODFILE='"fs/bcachefs/bcachefs"' -DKBUILD_BASENAME='"trace"' -DKBUILD_MODNAME='"bcachefs"' -D__KBUILD_MODNAME=kmod_bcachefs fs/bcachefs/trace.c
--
>> lib/lzo/lzo1x_compress.c:53:54: sparse: sparse: bad integer constant expression
>> lib/lzo/lzo1x_compress.c:53:54: sparse: sparse: static assertion failed: "min(ip_end, ip + (2047 + 4) + 1) signedness error, fix types or consider umin() before min_t()"
--
>> fs/ntfs3/lznt.c:157:16: sparse: sparse: bad integer constant expression
>> fs/ntfs3/lznt.c:157:16: sparse: sparse: static assertion failed: "min(cmpr + 0x1000 + sizeof(short), cmpr_end) signedness error, fix types or consider umin() before min_t()"
vim +83 crypto/skcipher.c
b286d8b1a69066 Herbert Xu 2016-11-22 75
b286d8b1a69066 Herbert Xu 2016-11-22 76 /* Get a spot of the specified length that does not straddle a page.
b286d8b1a69066 Herbert Xu 2016-11-22 77 * The caller needs to ensure that there is enough space for this operation.
b286d8b1a69066 Herbert Xu 2016-11-22 78 */
b286d8b1a69066 Herbert Xu 2016-11-22 79 static inline u8 *skcipher_get_spot(u8 *start, unsigned int len)
b286d8b1a69066 Herbert Xu 2016-11-22 80 {
b286d8b1a69066 Herbert Xu 2016-11-22 81 u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK);
b286d8b1a69066 Herbert Xu 2016-11-22 82
b286d8b1a69066 Herbert Xu 2016-11-22 @83 return max(start, end_page);
b286d8b1a69066 Herbert Xu 2016-11-22 84 }
b286d8b1a69066 Herbert Xu 2016-11-22 85
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-25 17:02 ` Linus Torvalds
@ 2024-07-26 9:43 ` Lorenzo Stoakes
2024-07-26 12:57 ` David Laight
0 siblings, 1 reply; 12+ messages in thread
From: Lorenzo Stoakes @ 2024-07-26 9:43 UTC (permalink / raw)
To: Linus Torvalds
Cc: David Laight, Arnd Bergmann, linux-kernel@vger.kernel.org,
Matthew Wilcox, Christoph Hellwig, Andrew Morton, Andy Shevchenko,
Dan Carpenter, Jason A . Donenfeld, pedro.falcato@gmail.com,
Mateusz Guzik, linux-mm@kvack.org
On Thu, Jul 25, 2024 at 10:02:45AM GMT, Linus Torvalds wrote:
> On Thu, 25 Jul 2024 at 02:01, David Laight <David.Laight@aculab.com> wrote:
> >
> > The condition is '>= 0' so it doesn't matter if it is '1' or '0'.
>
> Yes, but that's because the whole conditional is so inexplicably complex.
>
> But the explanation is:
>
> > That gives a 'comparison of unsigned type against 0 is always true' warning.
> > (The compiler generates that for code in the unused branches of both
> > __builtin_choose_expr() and _Generic().)
> > Moving the comparison to the outer level stops all such compiler warnings.
>
> Christ. This whole series is a nightmare of "add complexity to deal
> with stupid issues".
>
> But the kernel test robot clearly found even more issues.
>
> I think we need to just go back to the old code. It was stupid and
> limited and caused us to have to be more careful about types than was
> strictly necessary.
The problem is simply reverting reveals that seemingly a _ton_ of code has
come to rely on the relaxed conditions.
When I went to gather the numbers for my initial report I had to manually
fix up every case which was rather painful, and that was just a defconfig +
a few extra options. allmodconfig is likely to be a hellscape.
I've not dug deep into the ins + outs of this, so forgive me for being
vague (Arnd has a far clearer understanding) - but it seems that the
majority of the complexity comes from having to absolutely ensure all this
works for compile-time constant values.
Arnd had a look through and determined there weren't _too_ many cases where
we need this (for instance array sizes).
So I wonder whether we can't just vastly simplify this stuff (and reducing
the macro expansion hell) for the usual case, and implement something like
cmin()/cmax() or whatever for the true-constant cases?
>
> But it was also about a million times simpler, and didn't cause build
> time regressions.
>
:)
> Linus
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH 4/7] minmax: Simplify signedness check
2024-07-26 9:43 ` Lorenzo Stoakes
@ 2024-07-26 12:57 ` David Laight
2024-07-26 13:27 ` Lorenzo Stoakes
0 siblings, 1 reply; 12+ messages in thread
From: David Laight @ 2024-07-26 12:57 UTC (permalink / raw)
To: 'Lorenzo Stoakes', Linus Torvalds
Cc: Arnd Bergmann, linux-kernel@vger.kernel.org, Matthew Wilcox,
Christoph Hellwig, Andrew Morton, Andy Shevchenko, Dan Carpenter,
Jason A . Donenfeld, pedro.falcato@gmail.com, Mateusz Guzik,
linux-mm@kvack.org
From: Lorenzo Stoakes
> Sent: 26 July 2024 10:44
>
> On Thu, Jul 25, 2024 at 10:02:45AM GMT, Linus Torvalds wrote:
> > On Thu, 25 Jul 2024 at 02:01, David Laight <David.Laight@aculab.com> wrote:
> > >
> > > The condition is '>= 0' so it doesn't matter if it is '1' or '0'.
> >
> > Yes, but that's because the whole conditional is so inexplicably complex.
> >
> > But the explanation is:
> >
> > > That gives a 'comparison of unsigned type against 0 is always true' warning.
> > > (The compiler generates that for code in the unused branches of both
> > > __builtin_choose_expr() and _Generic().)
> > > Moving the comparison to the outer level stops all such compiler warnings.
> >
> > Christ. This whole series is a nightmare of "add complexity to deal
> > with stupid issues".
> >
> > But the kernel test robot clearly found even more issues.
> >
> > I think we need to just go back to the old code. It was stupid and
> > limited and caused us to have to be more careful about types than was
> > strictly necessary.
>
> The problem is simply reverting reveals that seemingly a _ton_ of code has
> come to rely on the relaxed conditions.
>
> When I went to gather the numbers for my initial report I had to manually
> fix up every case which was rather painful, and that was just a defconfig +
> a few extra options. allmodconfig is likely to be a hellscape.
>
> I've not dug deep into the ins + outs of this, so forgive me for being
> vague (Arnd has a far clearer understanding) - but it seems that the
> majority of the complexity comes from having to absolutely ensure all this
> works for compile-time constant values.
The problems arise due to some odd uses, not just the requirement for compile-time
constants for on-stack array sizes.
The test robot report is for a test between pointers.
I thought there was one in the build I do - and it doesn't usually generate a warning.
This one is related to the different between a 'compile time constant' and
a 'constant integer expression'.
This is due to is_unsigned_type(t) being (t)-1 > 0 but (type *)x not being
'constant enough' unless 'x' is zero.
Fixable by something like:
(__if_constexpr((t)-1, (t)-1, 1) > 0)
But that requires two expansions of the type.
Now the type could be that of the unique temporary - but that would make it
all more complicated.
There are fewer min/max of pointers than when constants are needed.
So requiring them be min_ptr() wouldn't be a massive change.
> Arnd had a look through and determined there weren't _too_ many cases where
> we need this (for instance array sizes).
>
> So I wonder whether we can't just vastly simplify this stuff (and reducing
> the macro expansion hell) for the usual case, and implement something like
> cmin()/cmax() or whatever for the true-constant cases?
I did do that in a patch set from much earlier in the year.
But Linus said they'd need to be MIN() and MAX() and that requires changes
to a few places where those are already defined.
> > But it was also about a million times simpler, and didn't cause build
> > time regressions.
Just bugs because people did min_t(short, 65536, 128) and didn't expect zero.
It has to be said that the chances of a min(negative_value, unsigned_constant)
appearing are pretty slim.
All these tests are there to trap that case.
There is always the option of disabling the tests for 'normal' build, but
leaving them there for (say) the W=1 builds.
Then it won't matter as much if the tests slow down the build a little.
I think I have tried a W=1 build - but there are too many warnings/errors
from other places to get anywhere.
A lot are for 'unsigned_var >= 0' in paths that get optimised away.
The compiler doesn't help!
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] minmax: Simplify signedness check
2024-07-26 12:57 ` David Laight
@ 2024-07-26 13:27 ` Lorenzo Stoakes
0 siblings, 0 replies; 12+ messages in thread
From: Lorenzo Stoakes @ 2024-07-26 13:27 UTC (permalink / raw)
To: David Laight
Cc: Linus Torvalds, Arnd Bergmann, linux-kernel@vger.kernel.org,
Matthew Wilcox, Christoph Hellwig, Andrew Morton, Andy Shevchenko,
Dan Carpenter, Jason A . Donenfeld, pedro.falcato@gmail.com,
Mateusz Guzik, linux-mm@kvack.org
On Fri, Jul 26, 2024 at 12:57:43PM GMT, David Laight wrote:
> From: Lorenzo Stoakes
> > Sent: 26 July 2024 10:44
> >
> > On Thu, Jul 25, 2024 at 10:02:45AM GMT, Linus Torvalds wrote:
[snip]
> > > Christ. This whole series is a nightmare of "add complexity to deal
> > > with stupid issues".
> > >
> > > But the kernel test robot clearly found even more issues.
> > >
> > > I think we need to just go back to the old code. It was stupid and
> > > limited and caused us to have to be more careful about types than was
> > > strictly necessary.
> >
> > The problem is simply reverting reveals that seemingly a _ton_ of code has
> > come to rely on the relaxed conditions.
> >
> > When I went to gather the numbers for my initial report I had to manually
> > fix up every case which was rather painful, and that was just a defconfig +
> > a few extra options. allmodconfig is likely to be a hellscape.
> >
> > I've not dug deep into the ins + outs of this, so forgive me for being
> > vague (Arnd has a far clearer understanding) - but it seems that the
> > majority of the complexity comes from having to absolutely ensure all this
> > works for compile-time constant values.
>
> The problems arise due to some odd uses, not just the requirement for compile-time
> constants for on-stack array sizes.
Odd implies not many, same argument applies.
[snip]
>
> > Arnd had a look through and determined there weren't _too_ many cases where
> > we need this (for instance array sizes).
> >
> > So I wonder whether we can't just vastly simplify this stuff (and reducing
> > the macro expansion hell) for the usual case, and implement something like
> > cmin()/cmax() or whatever for the true-constant cases?
>
> I did do that in a patch set from much earlier in the year.
> But Linus said they'd need to be MIN() and MAX() and that requires changes
> to a few places where those are already defined.
OK, so what's stopping you from doing that?
In order to implement a MIN()/MAX() you'd need to change call sites only
(should be a managable amount), so we can change this too?
I'm concerned that a solution is being proposed here and then handwaved
away...
Unfortunately a revert is no longer possible (I had to fix up 33 call sites
manually just for my defconfig build to compare perf before/after), so if
the intent is to eliminate the complexity, then we need a practical way
forward.
>
> > > But it was also about a million times simpler, and didn't cause build
> > > time regressions.
>
> Just bugs because people did min_t(short, 65536, 128) and didn't expect zero.
>
> It has to be said that the chances of a min(negative_value, unsigned_constant)
> appearing are pretty slim.
> All these tests are there to trap that case.
>
> There is always the option of disabling the tests for 'normal' build, but
> leaving them there for (say) the W=1 builds.
> Then it won't matter as much if the tests slow down the build a little.
Very much NAK disabling tests as a solution! Also leaving them for a build
that's apparently broken... yeah not a fan.
>
> I think I have tried a W=1 build - but there are too many warnings/errors
> from other places to get anywhere.
> A lot are for 'unsigned_var >= 0' in paths that get optimised away.
> The compiler doesn't help!
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-07-26 13:27 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 19:28 [PATCH 4/7] minmax: Simplify signedness check kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2024-07-25 20:02 kernel test robot
2024-07-24 14:26 [PATCH 0/7] minmax: reduce compilation time David Laight
2024-07-24 14:30 ` [PATCH 4/7] minmax: Simplify signedness check David Laight
2024-07-24 16:48 ` Arnd Bergmann
2024-07-24 20:02 ` Linus Torvalds
2024-07-25 9:00 ` David Laight
2024-07-25 17:02 ` Linus Torvalds
2024-07-26 9:43 ` Lorenzo Stoakes
2024-07-26 12:57 ` David Laight
2024-07-26 13:27 ` Lorenzo Stoakes
2024-07-25 13:24 ` kernel test robot
2024-07-25 16:39 ` David Laight
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.