Re: [PATCH] media: atomisp: silence "dubious: !x | !y" warning

2021-04-18 Thread Luc Van Oostenryck
On Sat, Apr 17, 2021 at 09:31:32PM +, David Laight wrote: > > > Upon running sparse, "warning: dubious: !x | !y" is brought to notice > > > for this file. Logical and bitwise OR are basically the same in this > > > context so it doesn't cause a runtime bug. But let's change it to > > >

Re: [PATCH 00/11] pragma once: treewide conversion

2021-02-28 Thread Luc Van Oostenryck
On Sun, Feb 28, 2021 at 10:34:46PM +0300, Alexey Dobriyan wrote: > > gcc does > > open "/" + "whatever between quotes" > fstat > > so that "1.h" and "./1.h" differ When I try the following with GCC 10.2: $ cat header.h #pragma once #include "./header.h"

Re: [PATCH] [v2] linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP*

2021-02-26 Thread Luc Van Oostenryck
Acked-by: Luc Van Oostenryck Thanks, -- Luc

[PATCH] sparse: can do constant folding of __builtin_bswap*()

2021-02-26 Thread Luc Van Oostenryck
and remove the corresponding test of __CHECKER__. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler-gcc.h | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 74c6c0486eed..d1016cc6798a 100644 --- a/inc

Re: [PATCH] linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP*

2021-02-25 Thread Luc Van Oostenryck
On Thu, Feb 25, 2021 at 05:45:09PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually > exclusive") > Signed-off-by: Arnd Bergmann > --- > include/linux/compiler-clang.h | 10 ++ > 1 file changed, 10

Re: [PATCH v2 2/4] usb: typec: tps6598x: Add trace event for status register

2021-02-14 Thread Luc Van Oostenryck
On Sun, Feb 14, 2021 at 11:00:48AM -0800, Linus Torvalds wrote: > On Sun, Feb 14, 2021 at 10:42 AM Ramsay Jones > wrote: > > > > > > > > I looked around but didn't find any hints how to fix this. Any pointers > > > I missed (added the sparse list to cc:)? > > > > This is a limitation of sparse;

[PATCH] sh: fix sparse annotation in SH's __get_user_check()

2021-01-23 Thread Luc Van Oostenryck
__user annotation (this remove ~700 warnings when using defconfig). Link: https://lore.kernel.org/r/202101141753.ropiz9nh-...@intel.com Reported-by: kernel test robot Reported-by: Oliver Hartkopp Signed-off-by: Luc Van Oostenryck --- arch/sh/include/asm/uaccess.h | 2 +- 1 file changed, 1

Re: sparse annotation for error types?

2020-12-05 Thread Luc Van Oostenryck
On Sat, Dec 05, 2020 at 03:10:15PM -0800, Linus Torvalds wrote: > On Sat, Dec 5, 2020 at 2:34 PM Jakub Kicinski wrote: > > > > Am I the only one who thinks this would be a good idea? > > err = third_step(obj, 0); > >err_undo_2s: > second_undo(obj); >err_undo_1s: >

Re: [PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-21 Thread Luc Van Oostenryck
On Sat, Nov 21, 2020 at 09:29:54PM +0100, Jakub Jelinek wrote: > On Sat, Nov 21, 2020 at 09:23:10PM +0100, Luc Van Oostenryck wrote: > > On Fri, Nov 20, 2020 at 01:51:54PM +0100, Peter Zijlstra wrote: > > > > > > Other option would be to change th

Re: [PATCH] ilog2: Improve ilog2 for constant arguments

2020-11-21 Thread Luc Van Oostenryck
On Fri, Nov 20, 2020 at 01:51:54PM +0100, Peter Zijlstra wrote: > > Other option would be to change the const_ilog2 macro, though as the > description says it is meant to be used also in C constant expressions, > and while GCC will fold it to constant with constant argument even in > those,

Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer

2020-10-28 Thread Luc Van Oostenryck
On Tue, Oct 27, 2020 at 12:23:03PM +0100, Greg KH wrote: > > Are you sure these changes are correct? This isn't just a list of > structures after this at the end of the structure? > > Please look at commit 5979afa2c4d1 ("staging: Replace zero-length array > with flexible-array member") which

Sparse improvements & regressions for Linux v5.9-rc1 -> v5.10-rc1

2020-10-27 Thread Luc Van Oostenryck
Hi, Here is a comparison of Sparse's unique warnings between v5.9-rc1 & v5.10-rc1 on x86-64 (defconfig + allyesconfig). This time, there is a VERY significant decrease in the number of warnings, almost 20% less. On ppc64, the difference is 31%. This big difference is mainly but not only caused

Re: [PATCH] asm-generic: percpu: avoid Wshadow warning

2020-10-26 Thread Luc Van Oostenryck
e included, which is fairly annoying. > > Rename the variables to avoid shadowing and shut up the warning. Looks good to me. Fell free to add my: Reviewed-by: Luc Van Oostenryck

Re: sound/pci/au88x0/au88x0_core.c:2029 vortex_adb_checkinout() warn: signedness bug returning '(-22)'

2020-10-09 Thread Luc Van Oostenryck
On Fri, Oct 09, 2020 at 03:00:43PM +0300, kernel test robot wrote: > Hi Luc, > > First bad commit (maybe != root cause): > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: c85fb28b6f999db9928b841f63f1beeb3074eeca > commit:

Re: [PATCH v3 3/3] openrisc: Fix issue with get_user for 64-bit values

2020-09-11 Thread Luc Van Oostenryck
ll combinations. Also I > ran make C=1 to confirm no new sparse warnings came up. It all looks > clean to me. It looks correct to me too now at C & assembly level. Feel free to add my: Reviewed-by: Luc Van Oostenryck -- Luc

Re: [OpenRISC] [PATCH v2 3/3] openrisc: Fix issue with get_user for 64-bit values

2020-09-05 Thread Luc Van Oostenryck
On Sun, Sep 06, 2020 at 06:34:08AM +0900, Stafford Horne wrote: > On Sat, Sep 05, 2020 at 03:57:14PM +0200, Luc Van Oostenryck wrote: > > On Sat, Sep 05, 2020 at 10:19:35PM +0900, Stafford Horne wrote: > > > > Hi, > > > > The change for 64-bit get_user() looks go

Re: [PATCH v2 3/3] openrisc: Fix issue with get_user for 64-bit values

2020-09-05 Thread Luc Van Oostenryck
On Sat, Sep 05, 2020 at 10:19:35PM +0900, Stafford Horne wrote: Hi, The change for 64-bit get_user() looks good to me. But I wonder, given that openrisc is big-endian, what will happen you have the opposite situation: u32 *ptr; u64 val; ... get_user(val, ptr);

Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits()

2020-08-30 Thread Luc Van Oostenryck
On Sat, Aug 29, 2020 at 10:29:55AM -0700, Linus Torvalds wrote: > On Sat, Aug 29, 2020 at 5:46 AM Luc Van Oostenryck > wrote: > > > > But the pointer is already 32-bit, so simply cast the pointer to u32. > > Yeah, that code was completely pointless. If the pointer ha

[PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits()

2020-08-29 Thread Luc Van Oostenryck
ger.kernel.org Signed-off-by: Luc Van Oostenryck --- drivers/dma/fsldma.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index 56f18ae99233..6f6fa7641fa2 100644 --- a/drivers/dma/fsldma.h +++ b/drivers/dma/fsldma.h @@ -205,7 +2

Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()

2020-08-28 Thread Luc Van Oostenryck
On Fri, Aug 28, 2020 at 09:04:28PM +0200, Miguel Ojeda wrote: > Hi Luc, > > On Fri, Aug 28, 2020 at 10:53 AM Luc Van Oostenryck > wrote: > > > > Hi Miguel, > > > > Could you also take this patch in your queue? > > It has already be sent twice bu

[PATCH] sparse: use static inline for __chk_{user,io}_ptr()

2020-08-28 Thread Luc Van Oostenryck
ions and so influence the result of sparse's analysis of context/locking. Fix this by changing these calls into static inline calls with an empty body. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Hi Miguel, Could

Re: [PATCH] fix comment concerning GCC 4.6

2020-08-28 Thread Luc Van Oostenryck
On Thu, Aug 27, 2020 at 09:50:45AM +0200, Miguel Ojeda wrote: > Hi Luc, > > On Tue, Aug 25, 2020 at 1:25 AM Luc Van Oostenryck > wrote: > > > > GCC 4.6 is not supported anymore, so remove a reference to it, > > leaving just the part about version prior GCC 5.

[PATCH] remove comment about sparse not supporting __has_attribute

2020-08-24 Thread Luc Van Oostenryck
Sparse supports __has_attribute() since 2018-08-31, so the comment is not true anymore but more importantly is rather confusing. So remove it. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler_attributes.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/linux

[PATCH] fix comment concerning GCC 4.6

2020-08-24 Thread Luc Van Oostenryck
GCC 4.6 is not supported anymore, so remove a reference to it, leaving just the part about version prior GCC 5. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler_attributes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler_attributes.h b

Re: Linux 5.9-rc1 (sparse? kernel/time/timekeeping.c)

2020-08-16 Thread Luc Van Oostenryck
On Sun, Aug 16, 2020 at 06:35:26PM -0700, Randy Dunlap wrote: > > on x86_64, allmodconfig: > > $ gcc --version > gcc (SUSE Linux) 7.5.0 > > $ sparse --version > 0.6.2 > > > I seem to be having some problems with kernel/time/timekeeping.c, > including a segfault. > > a. Is it sparse that

Sparse improvements & regressions for Linux v5.8-rc1 -> v5.9-rc1

2020-08-16 Thread Luc Van Oostenryck
Hi, Here is a comparison of Sparse's unique warnings between v5.8-rc1 & v5.9-rc1 on x86-64 (defconfig + allyesconfig). Note that the differences are be caused by changes in the kernel and in Sparse. The raw logs as well as the result of the processing giving the 'unique warnings' are available

Re: [PATCH v5 06/17] sched/debug: Output SD flag names rather than their values

2020-08-13 Thread Luc Van Oostenryck
On Wed, Aug 12, 2020 at 07:51:08PM +0100, Valentin Schneider wrote: > On 12/08/20 17:35, kernel test robot wrote: > > > config: i386-randconfig-s001-20200811 (attached as .config) > > reproduce: > > # sparse version: v0.6.2-168-g9554805c-dirty > > make W=1 C=1

Re: [PATCH v2 5/6] openrisc: signal: Fix sparse address space warnings

2020-08-08 Thread Luc Van Oostenryck
On Sun, Aug 09, 2020 at 07:48:22AM +0900, Stafford Horne wrote: > On Thu, Aug 06, 2020 at 09:04:49PM +0200, Luc Van Oostenryck wrote: > > On Thu, Aug 06, 2020 at 06:07:24AM +0900, Stafford Horne wrote: > > > --- > > > arch/openrisc/kernel/signal.c | 14 +++-

Re: fs/erofs/zdata.c:198:22: sparse: sparse: non size-preserving integer to pointer cast

2020-08-07 Thread Luc Van Oostenryck
ap() to implement cmpxchg(). This builtin has a return type which depends on its arguments while sparse was always using 'int' as the return type. A patch is on the way. Regards, -- Luc Van Oostenryck

Re: drivers/video/fbdev/pxafb.c:916:24: sparse: sparse: incorrect type in assignment (different address spaces)

2020-08-07 Thread Luc Van Oostenryck
On Fri, Aug 07, 2020 at 06:37:36PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: 86cfccb66937dd6cbf26ed619958b9e587e6a115 > commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to > define

[RESEND PATCH] sparse: use static inline for __chk_{user,io}_ptr()

2020-08-06 Thread Luc Van Oostenryck
ions and so influence the result of sparse's analysis of context/locking. Fix this by changing these calls into static inline calls with an empty body. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc

Re: [PATCH v2 0/6] OpenRISC header and sparse warning fixes for 5.9

2020-08-06 Thread Luc Van Oostenryck
es for OpenRISC sparse warnings. The kbuild robots report > many issues related to issues with OpenRISC headers having missing or > incorrect > sparse annotations. The changes look quite good to me (I just add 2 nits for patches 5 & 6). Fell free to add my Reviewed-by: Luc Van Oostenryck

Re: [PATCH v2 5/6] openrisc: signal: Fix sparse address space warnings

2020-08-06 Thread Luc Van Oostenryck
On Thu, Aug 06, 2020 at 06:07:24AM +0900, Stafford Horne wrote: > --- > arch/openrisc/kernel/signal.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c > index 4f0754874d78..7ce0728412f6 100644 >

Re: [PATCH v2 6/6] openrisc: uaccess: Add user address space check to access_ok

2020-08-06 Thread Luc Van Oostenryck
On Thu, Aug 06, 2020 at 06:07:25AM +0900, Stafford Horne wrote: > Now that __user annotations are fixed for openrisc uaccess api's we can > add checking to the access_ok macro. This patch adds the __chk_user_ptr > check, on normal builds the added check is a nop. > > Signed-off-by: Stafford

Re: [PATCH 6/6] openrisc: uaccess: Add user address space check to access_ok

2020-08-04 Thread Luc Van Oostenryck
On Tue, Aug 04, 2020 at 01:23:54PM +0900, Stafford Horne wrote: > Now that __user annotations are fixed for openrisc uaccess api's we can > add checking to the access_ok macro. This patch adds the __chk_user_ptr > check, on normal builds the added check is a nop. > > Signed-off-by: Stafford

Re: [PATCH 3/6] openrisc: uaccess: Use static inline function in access_ok

2020-08-04 Thread Luc Van Oostenryck
On Tue, Aug 04, 2020 at 01:23:51PM +0900, Stafford Horne wrote: > As suggested by Linus when reviewing commit 9cb2feb4d21d > ("arch/openrisc: Fix issues with access_ok()") last year; making > __range_ok an inline function also fixes the used twice issue that the > commit was fixing. I agree it's

Re: [PATCH 2/6] openrisc: uaccess: Fix sparse address space warnings

2020-08-04 Thread Luc Van Oostenryck
On Tue, Aug 04, 2020 at 01:23:50PM +0900, Stafford Horne wrote: > The OpenRISC user access functions put_user(), get_user() and > clear_user() were missing proper sparse annotations. This generated > warnings like the below. > > This patch adds the annotations to fix the warnings. > > Example

[PATCH] doc: remove stray HTML entity in ''

2020-07-28 Thread Luc Van Oostenryck
An excerpt from POSIX contains three occurrences of '' but the first two are spelled starting with an HTML entity: 'slash>' Fix this by replacing the stray HTML entity by a '<'. Signed-off-by: Luc Van Oostenryck --- Documentation/filesystems/path-lookup.rst | 4 ++-- 1 file chan

Re: [PATCH 01/26] bpfilter: fix up a sparse annotation

2020-07-23 Thread Luc Van Oostenryck
On Thu, Jul 23, 2020 at 08:08:43AM +0200, Christoph Hellwig wrote: > The __user doesn't make sense when casting to an integer type, just > switch to a uintptr_t cast which also removes the need for the __force. Feel free to add my: Reviewed-by: Luc Van Oostenryck -- Luc

Re: [PATCH 02/24] bpfilter: fix up a sparse annotation

2020-07-20 Thread Luc Van Oostenryck
On Mon, Jul 20, 2020 at 02:47:15PM +0200, Christoph Hellwig wrote: > The __user doesn't make sense when casting to an integer type. > > Signed-off-by: Christoph Hellwig > --- > net/bpfilter/bpfilter_kern.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: Sparse improvements & regressions for Linux v5.7-rc1 -> v5.8-rc1

2020-07-08 Thread Luc Van Oostenryck
On Wed, Jul 08, 2020 at 12:59:04PM +0300, Dan Carpenter wrote: > On Wed, Jul 08, 2020 at 02:06:51AM +0200, Luc Van Oostenryck wrote: > > I've finally written a silly script to easily compare my tests > > of Sparse on the kernel. So, it's now easy to share those results. > >

Sparse improvements & regressions for Linux v5.7-rc1 -> v5.8-rc1

2020-07-07 Thread Luc Van Oostenryck
I've finally written a silly script to easily compare my tests of Sparse on the kernel. So, it's now easy to share those results. It's a comparison of Sparse's unique warnings between v5.7-rc1 & v5.8-rc1 on x86-64 (defconfig + allyesconfig). The results are quite similar on other architectures.

Re: [PATCH 00/14] tidy-up options / reorganize lib.c

2020-07-02 Thread Luc Van Oostenryck
Deepest apologies, I've sent this to the wrong ML. -- Luc

[PATCH] testsuite: add new flag '-p' to subcommand 'format'

2020-07-02 Thread Luc Van Oostenryck
This flag facilitate the creation of testcases for preprocessing. Signed-off-by: Luc Van Oostenryck --- validation/test-suite | 4 1 file changed, 4 insertions(+) diff --git a/validation/test-suite b/validation/test-suite index d351ebf3c428..f7d992dc7c8c 100755 --- a/validation/test-suite

[PATCH 06/15] options: move helpers up

2020-07-02 Thread Luc Van Oostenryck
The helpers for parsing the options are often situated just above the first function using them. As result, these helpers can be found a bit everywhere in the code, it's messy and doesn't help to reuse these helpers. So, move all these helpers to the top. Signed-off-by: Luc Van Oostenryck

[PATCH 05/15] options: handle_onoff_switch() can handle any flags, not only warnings

2020-07-02 Thread Luc Van Oostenryck
So, use 'flag' instead of 'warning' for variable and function names. Signed-off-by: Luc Van Oostenryck --- lib.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib.c b/lib.c index 9acdc60fc416..c27773097127 100644 --- a/lib.c +++ b

[PATCH 08/15] options: avoid spaces between function name and arguments list

2020-07-02 Thread Luc Van Oostenryck
-off-by: Luc Van Oostenryck --- lib.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib.c b/lib.c index 5f4e6b2d76c8..b3bacb180cac 100644 --- a/lib.c +++ b/lib.c @@ -570,7 +570,7 @@ OPT_NUMERIC(uint, unsigned int, strtoul) static char

[PATCH 13/15] cleanup: move predefines in a separate file

2020-07-02 Thread Luc Van Oostenryck
Now that option parsing have moved to a separate file, move everything related to predefined macros to a separate file too. Signed-off-by: Luc Van Oostenryck --- Makefile| 1 + lib.c | 221 --- lib.h | 1 + predefine.c | 225

[PATCH 14/15] cleanup: move parsing helpers to parse.c

2020-07-02 Thread Luc Van Oostenryck
lib.c contains 2-3 helpers fro parsing. Move these to parse.c. Signed-off-by: Luc Van Oostenryck --- lib.c | 38 -- parse.c | 38 ++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib.c b/lib.c index

[PATCH 15/15] cleanup: move hexval() to utils.c

2020-07-02 Thread Luc Van Oostenryck
Now lib.c contains almost nothing else than library entrypoints. Move a small utility, hexval(), to utils.c to complete this cleanup. Signed-off-by: Luc Van Oostenryck --- lib.c | 17 - lib.h | 2 -- utils.c | 17 + utils.h | 4 4 files changed, 21

[PATCH 10/15] options: add a small helper: handle_switch_finalize()

2020-07-02 Thread Luc Van Oostenryck
This is just to isolate the details about which switch need an extra 'finalization' in a separate function in preparation to moving all the parsing code in a separate file. Signed-off-by: Luc Van Oostenryck --- lib.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH 12/15] options: keep the options sorted

2020-07-02 Thread Luc Van Oostenryck
The declarations and definitions of the variables corresponding to the options half-sorted half-unsorted. Sort them a little more. Signed-off-by: Luc Van Oostenryck --- options.c | 98 +++--- options.h | 137

[PATCH 04/15] options: make Wsparse_error less special

2020-07-02 Thread Luc Van Oostenryck
-Wsparse-error should not be enabled with -Wsparse-all, this is special cased in the condition in loop handling -Wsparse-all. However, the condition already handle warnings forced to off. So instead of explicitly checking for _error, it's enough to force Wsparse_error off. Signed-off-by: Luc Van

[PATCH 11/15] options: move option parsing in a separate file

2020-07-02 Thread Luc Van Oostenryck
lib.c contains to much things and is too hard to keep tidy. So, move everything related to option parsing in it's own file. Signed-off-by: Luc Van Oostenryck --- Makefile | 1 + lib.c | 982 + lib.h | 117 +-- options.c | 998

[PATCH 03/15] options: move on top the definition of warning type enums

2020-07-02 Thread Luc Van Oostenryck
This allows to reuse these enums in earlier helpers. Signed-off-by: Luc Van Oostenryck --- lib.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib.c b/lib.c index 5128a5b64e9e..43d55a0648ee 100644 --- a/lib.c +++ b/lib.c @@ -250,6 +250,12 @@ void die(const

[PATCH 07/15] options: alphasort the handle_switch_[a-zA_Z]()

2020-07-02 Thread Luc Van Oostenryck
These function have probably been added in 'historical order' and as result it's not easy to quickly see where they're defined. Change this arranging them in asciibetical order. Signed-off-by: Luc Van Oostenryck --- lib.c | 656 +- 1 file

[PATCH 02/15] options: move -Wsparse-all's processing out of handle_onoff_switch()

2020-07-02 Thread Luc Van Oostenryck
Since handle_onoff_switch() can be used for other flags than the warnings, the processing of -Wsparse-all should move elsewhere. So move it into handle_switch_W(). Signed-off-by: Luc Van Oostenryck --- lib.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

[PATCH 09/15] options: move declaration of tabstop out of "token.h"

2020-07-02 Thread Luc Van Oostenryck
o "lib.h". Signed-off-by: Luc Van Oostenryck --- lib.h | 1 + token.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.h b/lib.h index 4f67958efdb9..e938f18dfc92 100644 --- a/lib.h +++ b/lib.h @@ -48,6 +48,7 @@ extern int die_if_error; extern int repeat_p

[PATCH 00/14] tidy-up options / reorganize lib.c

2020-07-02 Thread Luc Van Oostenryck
sorted *) move options parsing in a separate file *) move predefine-related stuff in a separate file Luc Van Oostenryck (15): options: let handle_onoff_switch() use null terminated arrays options: move -Wsparse-all's processing out of handle_onoff_switch() options: move on top

[PATCH 01/15] options: let handle_onoff_switch() use null terminated arrays

2020-07-02 Thread Luc Van Oostenryck
This makes things slightly easier to use. Signed-off-by: Luc Van Oostenryck --- lib.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib.c b/lib.c index e56788260cb7..709dd5176112 100644 --- a/lib.c +++ b/lib.c @@ -529,14 +529,14 @@ enum

[PATCH v2 2/3] pci: use anonymous 'enum' instead of 'enum pci_channel_state'

2020-07-02 Thread Luc Van Oostenryck
For typechecking reasons, the typedef 'pci_channel_state_t' should be used instead of the 'enum pci_channel_state'. One simple way to enforce this is to remove the definition of 'enum pci_channel_state' and replace it by an anonymous 'enum'. Signed-off-by: Luc Van Oostenryck --- include/linux

[PATCH v2 1/3] pci: use 'pci_channel_state_t' instead of 'enum pci_channel_state'

2020-07-02 Thread Luc Van Oostenryck
are bitwise, not the enum itself (sparse doesn't have the notion of 'bitwise enum'). This may change in some not too far future, hence the patch. Signed-off-by: Luc Van Oostenryck --- Documentation/PCI/pci-error-recovery.rst| 4 ++-- arch/powerpc/kernel/eeh_driver.c

[PATCH v2 0/3] pci: enforce usage of 'pci_channel_state_t'

2020-07-02 Thread Luc Van Oostenryck
' in the documentation Luc Van Oostenryck (3): pci: use 'pci_channel_state_t' instead of 'enum pci_channel_state' pci: use anonymous 'enum' instead of 'enum pci_channel_state' pci: update to doc to use 'pci_channel_state_t' Documentation/PCI/pci-error-recovery.rst| 8 arch/powerpc/kernel

[PATCH v2 3/3] pci: update to doc to use 'pci_channel_state_t'

2020-07-02 Thread Luc Van Oostenryck
equivalent definition: typedef enum { ... } pci_channel_state_t; which makes abstraction of the '__bitwise' which would otherwise just bring unneeded complications here. Signed-off-by: Luc Van Oostenryck --- Documentation/PCI/pci-error-recovery.rst | 4 ++-- 1 file changed, 2 insertions

Re: [PATCH] pci: consolidate typing of pci_error_handlers::error_detected()

2020-06-29 Thread Luc Van Oostenryck
On Mon, Jun 29, 2020 at 04:29:28PM -0500, Bjorn Helgaas wrote: > On Sun, Jun 28, 2020 at 06:12:33PM +0200, Luc Van Oostenryck wrote: > > The method struct pci_error_handlers::error_detected() is defined and > > documented as taking an 'enum pci_channel_state' for the second > &

[PATCH v2] doc: add link to sparse's home page/internal docs

2020-06-29 Thread Luc Van Oostenryck
. So, add a link to this in the kernel documentation. Signed-off-by: Luc Van Oostenryck --- Changes since v1: * fix a typo (s/kernl/kernel/) thanks to Mike Rapoport. Documentation/dev-tools/sparse.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/dev-tools/sparse.rst b

[PATCH] wilc1000: let wilc_mac_xmit() return NETDEV_TX_OK

2020-06-29 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'. Fix this by returning 'NETDEV_TX_OK' instead of '0'. Signed-off-by: Luc Van Oostenryck --- drivers/net

Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()

2020-06-29 Thread Luc Van Oostenryck
On Tue, Jun 30, 2020 at 02:08:36AM +0800, kernel test robot wrote: > Hi Luc, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on next-20200626] > [cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3] > [If your patch is applied to the wrong

[PATCH 06/15] net: arc_emac: fix arc_emac_tx()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/arc/emac_main.c

[PATCH 02/15] caif: fix caif_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/caif/caif_serial.c | 2

[PATCH 03/15] caif: fix cfspi_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too and returning NETDEV_TX_OK instead of 0 accordingly. Signed-off-by: Luc Van

[PATCH 01/15] cail,hsi: fix cfhsi_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too and returning NETDEV_TX_OK instead of 0 accordingly. Signed-off-by: Luc Van

[PATCH 09/15] net: pch_gbe: fix pch_gbe_xmit_frame()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/oki-semi/pch_gbe

[PATCH 04/15] caif: fix cfv_netdev_tx()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/caif/caif_virtio.c | 2

[PATCH 07/15] net: nb8800: fix nb8800_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/aurora/nb8800.c

[PATCH 08/15] net: nfp: fix nfp_net_tx()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/netronome/nfp

[PATCH 14/15] l2tp: fix l2tp_eth_dev_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- net/l2tp/l2tp_eth.c | 2 +- 1 file

[PATCH 15/15] cxgb4vf: fix t4vf_eth_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/chelsio/cxgb4vf

[PATCH 10/15] net: dwc-xlgmac: fix xlgmac_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/synopsys/dwc

[PATCH 12/15] usbnet: ipheth: fix ipheth_tx()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/usb/ipheth.c | 2 +- 1

[PATCH 11/15] net: plip: fix plip_tx_packet()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/plip/plip.c | 4 ++-- 1

[PATCH 13/15] net/hsr: fix hsr_dev_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- net/hsr/hsr_device.c | 2 +- 1 file

[PATCH 05/15] net: aquantia: fix aq_ndev_start_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too. Signed-off-by: Luc Van Oostenryck --- drivers/net/ethernet/aquantia

[PATCH 00/15] always use netdev_tx_t for xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The ndo_start_xmit() methods should return a 'netdev_tx_t', not an int, and so should return NETDEV_TX_OK, not 0. The patches in the series fix most of the remaning drivers and subsystems (those included in allyesconfig on x86). Luc Van Oostenryck (15): cail,hsi: fix cfhsi_xmit()'s return type

[PATCH] staging: ks7010: fix ks_wlan_start_xmit()'s return type

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'. Fix this by returning 'netdev_tx_t' in this driver too and usind 'NETDEV_TX_OK' instead of 0 accordingly. Signed-off-by: Luc Van

[PATCH] staging/wilc1000: let wilc_mac_xmit() to NETDEV_TX_OK

2020-06-28 Thread Luc Van Oostenryck
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'. Fix this by returning ''NETDEV_TX_OK' instead of 0. Signed-off-by: Luc Van Oostenryck --- drivers/staging

[PATCH] pci: consolidate typing of pci_error_handlers::error_detected()

2020-06-28 Thread Luc Van Oostenryck
the constants defined by the enum are bitwise, not the enum itself (sparse doesn't have the notion of 'bitwise enum'). This may change in some not too far future, hence the patch. Signed-off-by: Luc Van Oostenryck --- Documentation/PCI/pci-error-recovery.rst| 2 +- drivers/block/rsxx

[PATCH] doc: add link to sparse's home page/internal docs

2020-06-28 Thread Luc Van Oostenryck
. So, add a link to this in the kernel documentation. Signed-off-by: Luc Van Oostenryck --- Documentation/dev-tools/sparse.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/dev-tools/sparse.rst b/Documentation/dev-tools/sparse.rst index 6f4870528226..e20b8b8b78ed 100644

Re: [PATCH] doc: update URL for sparse's tarballs

2020-06-28 Thread Luc Van Oostenryck
On Fri, Jun 26, 2020 at 11:23:49AM -0600, Jonathan Corbet wrote: > > I've applied this, but it also seems like we're losing some information by > going from a wiki straight to a directory listing. It seems maybe we need > a link to the new documentation site in here as well? Yes. I hesitated to

[PATCH] sparse: use static inline for __chk_{user,io}_ptr()

2020-06-28 Thread Luc Van Oostenryck
ions and so influence the result of sparse's analysis of context/locking. Fix this by changing these calls into static inline calls with an empty body. Signed-off-by: Luc Van Oostenryck --- include/linux/compiler_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc

Re: [PATCH v3 08/15] arm64: kvm: Split hyp/switch.c to VHE/nVHE

2020-06-25 Thread Luc Van Oostenryck
On Thu, Jun 25, 2020 at 09:16:03AM +0100, Marc Zyngier wrote: > > I really wish we could turn these warnings off. They don't add much. > Or is there an annotation we could stick on the function (something > like __called_from_asm_please_leave_me_alone springs to mind...)? There is: '__visible'.

[PATCH] spi: fsl: add missing __iomem annotation

2020-06-22 Thread Luc Van Oostenryck
issing __iomem and make sparse & the bot happier. Reported-by: kernel test robot Signed-off-by: Luc Van Oostenryck --- drivers/spi/spi-fsl-spi.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 67

[PATCH] kbuild: run the checker after the compiler

2020-06-22 Thread Luc Van Oostenryck
-by: Luc Van Oostenryck --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2e8810b7e5ed..7ba6a752d5bd 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -252,9 +252,9

[PATCH] openrisc: fix __user in raw_copy_to_user()'s prototype

2020-06-22 Thread Luc Van Oostenryck
raw_copy_to_user()'s prototype seems to be a copy & paste of raw_copy_from_user() and as such has the __user annotation in the 'from' argument instead of the 'to'. So, move the __user annotation in the prototype to the 'to'. Reported-by: kernel test robot Signed-off-by: Luc Van Oosten

[PATCH] fix annotation of io{read,write}{16,32}be()

2020-06-22 Thread Luc Van Oostenryck
need a force cast that would solve nothing at all. So, do the conversion using swab{16,32}, like done in asm-generic for similar situations. Reported-by: kernel test robot Signed-off-by: Luc Van Oostenryck --- arch/alpha/include/asm/io.h | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH] lib/generic-radix-tree.c: remove unneeded __rcu

2020-06-21 Thread Luc Van Oostenryck
-tree.c:56:35:expected struct genradix_root *r lib/generic-radix-tree.c:56:35:got struct genradix_root [noderef] *__val with 6 other ones. So, correct root's type by removing this unneeded __rcu. Signed-off-by: Luc Van Oostenryck --- include/linux/generic-radix-tree.h | 2 +- 1 file

[PATCH] doc: update URL for sparse's tarballs

2020-06-21 Thread Luc Van Oostenryck
The URL given to get sparse's tarballs is sparse.wiki.kernel.org but the wiki will is deprecated in favor of sparse.docs.kernel.org. So, update this URL to the one where the tarballs can directly be found. Signed-off-by: Luc Van Oostenryck --- Documentation/dev-tools/sparse.rst | 4 ++-- 1

[PATCH] MAINTAINERS: update info for sparse

2020-06-21 Thread Luc Van Oostenryck
Update the info for sparse. More specifically: * change W entry to point to sparse.docs.kernel.org * add Q & B entry (patchwork & bugzilla) Signed-off-by: Luc Van Oostenryck --- MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINE

[PATCH] sparse: group the defines by functionality

2020-06-21 Thread Luc Van Oostenryck
By popular demand, reorder the defines for sparse annotations and group them by functionality. Link: lore.kernel.org/r/CAMuHMdWQsirja-h3wBcZezk+H2Q_HShhAks8Hc8ps5fTAp=o...@mail.gmail.com Cc: Geert Uytterhoeven Cc: Miguel Ojeda Signed-off-by: Luc Van Oostenryck --- include/linux

Re: [PATCH] sparse: use the _Generic() version of __unqual_scalar_typeof()

2020-06-19 Thread Luc Van Oostenryck
On Fri, Jun 19, 2020 at 11:26:59AM -0700, Linus Torvalds wrote: > On Thu, Jun 18, 2020 at 3:26 PM Luc Van Oostenryck > wrote: > > > > Note: a recent version of sparse will be needed (minimum v0.6.2-rc2 > >or later than 2020-05-28). > > Ok, it sounds like

  1   2   3   4   5   6   >