[PATCH] m32r: pass endianness info to sparse

2017-10-31 Thread Luc Van Oostenryck
endianness. Fix this by letting sparse know about the architecture endianness. To: triv...@kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Luc Van Oostenryck --- arch/m32r/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile index

Re: [PATCH] kernel.h: Avoid that sparse complains about using sizeof(void)

2018-07-15 Thread Luc Van Oostenryck
ch pain > > that I'm nervous to change it without some greater level of review. :) > > Honestly, I'd like to just encourage people to get the sparse update > from Luc Van Oostenryck instead. > > For a while there it looked like Chris Li would just pull from Luc, >

Re: [PATCH 2/2] of: reserved_mem: fix 'const' annotation

2017-05-11 Thread Luc Van Oostenryck
. ) ../drivers/of/of_reserved_mem.c:200:50:got void const *const data right? And we're talking about a function (pointer) type. Functions return a rvalue thus qualifiers are irrelevant for them, so having 'int const (*initfn)(...)' instead of 'int (*initfn)()' should solve nothing. Same for the others patch in this series. -- Luc Van Oostenryck

Re: [PATCH] FS: Fixing return type of unsigned_offsets

2017-05-11 Thread Luc Van Oostenryck
On Thu, May 11, 2017 at 8:07 AM, Al Viro wrote: > FVO"needed" equal to "needed to make sparse STFU"? If anything, that's > sparse being wrong - evaluate.c:check_assignment_type() should do > if (t == &ctype_bool) { > if (is_fouled_type(s)) >

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-20 Thread Luc Van Oostenryck
g I'm using it gave this: >1104 sizeof struct page = 56 Yes, I get this already with defconfig. It's a problem with sparse which ignore the alignment attribute (in fact all 'trailing' attributes in type declarations). I'm looking to fix it. -- Luc Van Oostenryck

Re: [PATCH v2] add -Wpointer-arith sparse flag to toggle sizeof(void) warnings

2018-04-08 Thread Luc Van Oostenryck
On Sat, Apr 07, 2018 at 11:58:05AM -1000, Joey Pabalinas wrote: > Recent changes to the min()/max() macros in include/linux/kernel.h > have added a lot of noise when compiling the kernel with Sparse checking > enabled. This mostly is due to the *huge* increase in the number of > sizeof(void) warnin

Re: [PATCH v4] sparse: add -Wpointer-arith flag to toggle sizeof(void) warnings

2018-04-11 Thread Luc Van Oostenryck
e new flag and add a validation case > for sizeof(void). > > CC: Kees Cook > CC: Linus Torvalds > CC: Martin Uecker > CC: Al Viro > CC: Christopher Li > CC: Joey Pabalinas > CC: Luc Van Oostenryck > Signed-off-by: Joey Pabalinas > Signed-off-by: Luc Van Oostenryck Thanks, Acked-by: Luc Van Oostenryck

Re: [PATCH v13 01/10] iomap: Use correct endian conversion function in mmio_writeXXbe

2018-03-21 Thread Luc Van Oostenryck
and code analysis tools alike. > > Signed-off-by: Logan Gunthorpe > Cc: Philippe Ombredanne > Cc: Thomas Gleixner > Cc: Kate Stewart > Cc: Greg Kroah-Hartman > Cc: Luc Van Oostenryck > --- > lib/iomap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

Re: [PATCH v14 02/10] iomap: Add big endian sparse annotations to mmio_{read|write}XXbe()

2018-03-22 Thread Luc Van Oostenryck
On Thu, Mar 22, 2018 at 11:16:55AM -0600, Logan Gunthorpe wrote: > Sparse produces a few warnings of the form: > > lib/iomap.c:84:9: warning: cast to restricted __be16 > > (The kbuild robot has recently started running such checks) Reviewed-by: Luc Van Oostenryck

Re: [PATCH 03/12] m68k/mac: Don't remap SWIM MMIO region

2018-04-09 Thread Luc Van Oostenryck
On Mon, Apr 09, 2018 at 02:54:30PM +0200, Geert Uytterhoeven wrote: > > > > - swim_base = ioremap(res->start, resource_size(res)); > > + swim_base = (struct swim __iomem *)res->start; > > I guess you need a __force to please sparse? Hi, Only pointer-to-pointer conversions may need __

Re: [PATCH v3] sparse: add -Wpointer-arith flag to toggle sizeof(void) warnings

2018-04-10 Thread Luc Van Oostenryck
On Mon, Apr 09, 2018 at 03:02:04PM -1000, Joey Pabalinas wrote: > Recent changes to the min()/max() macros in include/linux/kernel.h > have added a lot of noise when compiling the kernel with Sparse checking > enabled. This mostly is due to the *huge* increase in the number of > sizeof(void) warnin

Re: [tip:locking/core 9/11] include/asm-generic/atomic-instrumented.h:288:24: sparse: cast truncates bits from constant value (100 becomes 0)

2018-03-13 Thread Luc Van Oostenryck
de from branches that are never taken (which, surprise, need itself to have constant expressions already expanded). It's often annoying like the case here. OTOH, I don't think it's always a bad thing. Sometimes we want to have warnings even from code we know will not be executed (in this config but maybe it will in another one). Several solution would be possible: 1) removing all those early warnings (but then we'll loose more legitimate ones) 2) add an option to not issues those early warnings (ame as above). 3) move those warnings (and thus the expansion of the concerned constants) after trivial dead code elimination 4) add a very early pass to eliminate never taken branches 5) something else ? 1) & 2) are easy but not really acceptable. 3) can be good for some cases but not here, I think. 4) seems to way to go -- Luc Van Oostenryck

Re: [tip:locking/core 9/11] include/asm-generic/atomic-instrumented.h:288:24: sparse: cast truncates bits from constant value (100 becomes 0)

2018-03-13 Thread Luc Van Oostenryck
On Tue, Mar 13, 2018 at 07:08:06PM +0100, Peter Zijlstra wrote: > On Tue, Mar 13, 2018 at 07:00:17PM +0100, Luc Van Oostenryck wrote: > > The issue here is that sparse has a whole class of warnings that are > > given very early (here at expansion of constant expressions), before

[PATCH] MAINTAINERS: change Sparse's maintainer

2018-11-25 Thread Luc Van Oostenryck
I'm taking over the maintainance of Sparse so add myself as maintainer and move Christopher's info to CREDITS. Signed-off-by: Luc Van Oostenryck --- CREDITS | 4 MAINTAINERS | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CREDITS b/CREDITS index

Re: [PATCH v4 1/3] kernel.h: disable type-checks in container_of() for Sparse

2018-11-22 Thread Luc Van Oostenryck
arse for now. I would prefer that developers upgrade their version of sparse but ... Reviewed-by: Luc Van Oostenryck

Re: [PATCH v2 2/2] build_bug.h: remove all dummy BUILD_BUG_ON stubs for sparse

2018-11-16 Thread Luc Van Oostenryck
On Fri, Nov 16, 2018 at 03:27:25PM +0900, Masahiro Yamada wrote: > The introduction of these dummy BUILD_BUG_ON stubs dates back to > commit 903c0c7cdc21 ("sparse: define dummy BUILD_BUG_ON definition > for sparse"). At that time, BUILD_BUG_ON() was implemented with the > negative array trick, whic

Re: [PATCH v2 1/3] compiler-gcc: hide COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW from sparse

2018-11-16 Thread Luc Van Oostenryck
On Fri, Nov 09, 2018 at 10:35:32AM +0100, Johannes Berg wrote: > From: Johannes Berg > > Sparse doesn't support all the overflow builtins, so just hide > them from it to avoid lots of warnings/errors reported by it. The development version of sparse support these builtins since their introductio

Re: [PATCH v2 2/3] kernel.h: hide __is_constexpr() from sparse

2018-11-16 Thread Luc Van Oostenryck
On Fri, Nov 09, 2018 at 10:35:33AM +0100, Johannes Berg wrote: > From: Johannes Berg > > __is_constexpr() is a work of art, understandable only to the most > respected wizards of C. Even sparse doesn't seem to belong to that > group and warns that there's an "expression using sizeof(void)". > >

Re: [PATCH v3 1/3] compiler_types.h: make __builtin_types_compatible_p() noop for Sparse

2018-11-19 Thread Luc Van Oostenryck
On Mon, Nov 19, 2018 at 07:31:41PM +0900, Masahiro Yamada wrote: > When I tried to delete BUILD_BUG_ON stubs for sparse, the kbuild test > robot reported lots of Sparse warnings from container_of(), which > seem false positive. > > The following checker in container_of() seems to be causing someth

Re: [PATCH v3 3/3] build_bug.h: remove most of dummy BUILD_BUG_ON stubs for sparse

2018-11-19 Thread Luc Van Oostenryck
complain about the following code, which GCC is fine with: > > static const int x = 0; > int y = BUILD_BUG_ON_ZERO(x); > > Signed-off-by: Masahiro Yamada > Acked-by: Kees Cook Reviewed-by: Luc Van Oostenryck

Re: [RFC v1] copy_{to,from}_user(): only inline when !__CHECKER__

2018-12-09 Thread Luc Van Oostenryck
On Sun, Dec 09, 2018 at 02:25:23PM -0700, Tycho Andersen wrote: > Hi Al, > > On Sun, Dec 09, 2018 at 09:02:21PM +, Al Viro wrote: > > On Sun, Dec 09, 2018 at 01:44:49PM -0700, Tycho Andersen wrote: > > > While working on some additional copy_to_user() checks for sparse, I > > > noticed that sp

Re: [RFC v1] copy_{to,from}_user(): only inline when !__CHECKER__

2018-12-09 Thread Luc Van Oostenryck
On Sun, Dec 09, 2018 at 09:56:51PM +, Al Viro wrote: > On Sun, Dec 09, 2018 at 10:39:52PM +0100, Luc Van Oostenryck wrote: > > > There are several more or less bad/good solutions, like: > > * add raw_copy_{to,from}_user() in the list of checked function > > (n

Re: [PATCH] staging: erofs: Add braces to do-while statements

2018-12-09 Thread Luc Van Oostenryck
On Sun, Dec 09, 2018 at 08:40:29PM +0100, Greg KH wrote: > On Sun, Dec 09, 2018 at 09:27:01AM -0800, Joe Perches wrote: > > On Sun, 2018-12-09 at 17:20 +0100, Greg KH wrote: > > > On Sun, Dec 09, 2018 at 04:59:00PM +0100, Thomas Jespersen wrote: > > > > This fixes warning reported by sparse (with -

Re: [PATCH] binder: fix sparse warnings on locking context

2018-12-03 Thread Luc Van Oostenryck
er_lock); This one is questionnable because: 1) if !node->proc, then '&node->proc->inner_lock' is not acquired since it doesn't even exist. 2) OTOH, the function can't have the annotation 100% right because it semantics allows unbalanced locking depending on node->proc being null or not. But I see very well the intent and maybe it's a right solution. I dunno. Same for most of the following ones. Best regards, -- Luc Van Oostenryck

[PATCH] sparse: remove uneffective sparse disabling

2018-06-17 Thread Luc Van Oostenryck
d missed struct attributes") the checks are, in fact, not disabled anymore because of the more early include of "linux/compiler_types.h" So remove the now uneffective #undefery that was done to disable these warnings, as well as the associated comment. Signed-off-by: Luc Van Oos

[PATCH] h8300:let the checker know that size_t is ulong

2018-05-30 Thread Luc Van Oostenryck
g, telling it that size_t is unsigned long. Signed-off-by: Luc Van Oostenryck --- arch/h8300/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile index e1c02ca23..eaac6685f 100644 --- a/arch/h8300/Makefile +++ b/arch/h8300/Makefile @@ -

Re: [PATCH] riscv: pass machine size to sparse

2018-05-31 Thread Luc Van Oostenryck
On Thu, May 31, 2018 at 05:09:21AM -0700, Palmer Dabbelt wrote: > On Mon, 28 May 2018 23:14:20 PDT (-0700), yamada.masah...@socionext.com wrote: > > 2018-05-29 15:11 GMT+09:00 Christoph Hellwig : > > > On Mon, May 28, 2018 at 06:35:05PM +0200, Luc Van Oostenryck wrote: > >

[PATCH] riscv: add riscv-specific predefines to CHECKFLAGS

2018-05-31 Thread Luc Van Oostenryck
v too. Signed-off-by: Luc Van Oostenryck --- arch/riscv/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 76e958a54..6d4a5f6c3 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -71,6 +71,9 @@ KBUILD_CFLAGS_MODULE += $(call cc-o

[PATCH 0/3] riscv: fix sparse annotations

2018-06-01 Thread Luc Van Oostenryck
The RISC-V implementation seems to be quite clean regarding sparse annotations. There is anyway three small glitches which are corrected by this series. Note: the 3rd patch may need another solution. Luc Van Oostenryck (3): riscv: use NULL instead of a plain 0 riscv: no __user for

[PATCH 2/3] riscv: no __user for probe_kernel_address()

2018-06-01 Thread Luc Van Oostenryck
In is_valid_bugaddr(), probe_kernel_address() is called with the PC casted to (bug_inst_t __user *) but this function only take a plain void* as argument, not a __user pointer. Fix this by removing the unnneded __user in the cast. Signed-off-by: Luc Van Oostenryck --- arch/riscv/kernel/traps.c

[PATCH 1/3] riscv: use NULL instead of a plain 0

2018-06-01 Thread Luc Van Oostenryck
sbi_remote_sfence_vma() & sbi_remote_fence_i() takes a pointer as first argument but some macros call them with a plain 0 which, while legal C, is frowned upon in the kernel. Change this by replacing the 0 by NULL. Signed-off-by: Luc Van Oostenryck --- arch/riscv/include/asm/cacheflush.h

[PATCH 3/3] riscv: fix __user annotation for __copy_user()

2018-06-01 Thread Luc Van Oostenryck
ome kind of cast would be needed anyway. Note: another solution, maybe cleaner but slightly more complex, would be to declare two version of __copy_user, either in the asm file or via an alias, each having already the correct typing for raw_copy_{to,from}_user(). Signed-off-by: Luc

Re: [PATCH] mm: Change return type to vm_fault_t

2018-06-02 Thread Luc Van Oostenryck
On Sat, Jun 02, 2018 at 08:25:29PM +0530, Souptick Joarder wrote: > CHECK mm/gup.c > mm/gup.c:394:17: error: undefined identifier '__COUNTER__' > mm/gup.c:439:9: error: undefined identifier '__COUNTER__' > mm/gup.c:441:9: error: undefined identifier '__COUNTER__' > mm/gup.c:443:9: error: undefi

Re: [PATCH 3/3] riscv: fix __user annotation for __copy_user()

2018-06-12 Thread Luc Van Oostenryck
On Tue, Jun 12, 2018 at 7:12 PM, Palmer Dabbelt wrote: > On Mon, 11 Jun 2018 20:00:08 PDT (-0700), luc.vanoostenr...@gmail.com wrote: >> On Mon, Jun 11, 2018 at 12:01:37PM -0700, Palmer Dabbelt wrote: >>> >>> OK, I'll try and figure out what's going on. We've had a handful of >>> headaches trying

Re: [PATCH v13 05/25] kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS

2018-12-11 Thread Luc Van Oostenryck
On Thu, Dec 06, 2018 at 01:24:23PM +0100, Andrey Konovalov wrote: > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > index 3e7dafb3ea80..39f668d5066b 100644 > --- a/include/linux/compiler-clang.h > +++ b/include/linux/compiler-clang.h > @@ -16,9 +16,13 @@ > /* all cla

Re: [PATCH] staging: wilc1000: fix cast to restricted __le32

2019-01-07 Thread Luc Van Oostenryck
On Mon, Jan 07, 2019 at 03:54:37PM +0300, Dan Carpenter wrote: > I'm sort of surprised that the zero day bot didn't complain about this. > It probably should. > > The endianness checking is not turned on by default in Sparse. You have > to do "make C=1 CF=-D__CHECK_ENDIAN__" to turn it on. Bitwi

Re: [PATCH 1/3] kbuild: Add -Wshadow to sparse

2018-10-17 Thread Luc Van Oostenryck
and I saw it would add a lot of noise because of (valid) warnings coming from macros using a statement expression redeclaring variables like '__u', 'tmp', ... BTW, as far as I can see, sparse never had it enabled by default. Kind regards, -- Luc Van Oostenryck

Re: [PATCH sparse] parse: shifting by full number of bits is undefined

2018-10-26 Thread Luc Van Oostenryck
On Fri, Oct 26, 2018 at 05:17:00AM +0200, Jason A. Donenfeld wrote: > The type checker wasn't identifying upper bounds for huge unsigned > 64-bit numbers, because the right shift turned into a no-op: > > zx2c4@thinkpad /tmp $ cat sparse.c > enum { sparse_does_not_like_this = 0x8003ULL

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; wh

Re: [Y2038] [PATCH 04/11] posix timers:Introduce the 64bit methods with timespec64 type for k_clock structure

2015-04-22 Thread Luc Van Oostenryck
On Wed, Apr 22, 2015 at 03:50:45PM +0200, Arnd Bergmann wrote: > On Wednesday 22 April 2015 13:07:44 Arnd Bergmann wrote: ... > select, old_selct, pselect6: deprecated Small, copy&paste error here for pselect6. Luc -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the

Re: [PATCH] clockevents: timer-stm32: Fix build warning spotted by kbuild test robot

2015-05-27 Thread Luc Van Oostenryck
(u32)~0UL, data->base + TIM_ARR); > max_delta = readl_relaxed(data->base + TIM_ARR); > if (max_delta == ~0UL) { > prescaler = 1; Since the warning come from using a unsigned long constant while writel() expect an unsigned int, why not simply use ~0U ? L

Re: [PATCH 1/3] MIPS: R6: Use lightweight SYNC instruction in smp_* memory barriers

2015-06-02 Thread Luc Van Oostenryck
ot; (Mmmm, ok but ...) Nowhere is there something close to what is found in the revision 5.0 or later: "If an implementation does not use one of these non-zero values to define a different synchronization behavior, then that non-zero value of stype must act the same as stype zero completion

Re: [PATCH] sparse doesn't support indirect_branch attribute

2018-03-01 Thread Luc Van Oostenryck
On Wed, Feb 28, 2018 at 10:30:58AM +0900, Masahiro Yamada wrote: > 2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck : > > > > To compensate this, I sent a patch to use '-Wno-unknown-attribute' for > > kernel > > builds. Masahiro Yamada has already taken it to th

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

2018-04-26 Thread Luc Van Oostenryck
On Wed, Apr 25, 2018 at 06:44:38PM +0200, Janusz Lisiecki wrote: > Maybe inside ks_wlan_start_xmit, instead of "return 0;", there should be > "return NETDEV_TX_OK;" and "return NETDEV_TX_BUSY;" otherwise. It is just > suggestion. I see, yes. However, since: 1) this sort of change is really outside

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: fix batadv_interface_tx()'s return type

2018-04-26 Thread Luc Van Oostenryck
On Wed, Apr 25, 2018 at 07:35:00PM +0200, Sven Eckelmann wrote: > On Dienstag, 24. April 2018 15:18:46 CEST Luc Van Oostenryck wrote: > > The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', > > which is a typedef for an enum type, but the implementation i

Re: [PATCH] net: aquantia: fix aq_ndev_start_xmit()'s return type

2018-04-26 Thread Luc Van Oostenryck
On Tue, Apr 24, 2018 at 10:42:50AM -0400, David Miller wrote: > > Luc please don't submit such a huge number of patches all at one time. > > ... > > Finally, make this a true patch series. It is so much easier for > maintainers to work with a set of changes all doing the same thing if > you mak

[PATCH 1/3] can: janz-ican3: fix ican3_xmit()'s return type

2018-04-26 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 --- dr

[PATCH 3/3] can: xilinx: fix xcan_start_xmit()'s return type

2018-04-26 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 --- dr

[PATCH 2/3] can: sun4i: fix sun4ican_start_xmit()'s return type

2018-04-26 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

[PATCH 0/3] can: fix ndo_start_xmit()'s return type

2018-04-26 Thread Luc Van Oostenryck
ndo_start_xmit() is defined as returing an 'netdev_tx_t'. However, several can drivers use 'int' as the return type of their start_xmit() method. This series contains the fix for all three of them. Luc Van Oostenryck (3): can: janz-ican3: fix ican3_xmit()'s retu

[PATCH] kbuild: $(CHECK) doesnt need NOSTDINC_FLAGS twice

2018-05-28 Thread Luc Van Oostenryck
Currently, $(CHECK) receives NOSTDINC_FLAGS twice: * first directly in the main Makefile via CHECKFLAGS, * then indirectly in scripts/Makefile.build via c_flags. Since once is enough, leave the occurence via c_flags and remove the one via CHECKFLAGS. Signed-off-by: Luc Van Oostenryck

[PATCH] nds32: define __NDS32_E[BL]__ for sparse

2018-05-28 Thread Luc Van Oostenryck
by adding '-D__NDS32_E[BL]__' to CHECKFLAGS. Signed-off-by: Luc Van Oostenryck --- arch/nds32/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile index 513bb2e9b..031c67682 100644 --- a/arch/nds32/Makefile +++ b/arch/nds32/Makefile @@ -3

[PATCH] riscv: pass machine size to sparse

2018-05-28 Thread Luc Van Oostenryck
signed long' or is 64bit while sparse was compiled on a 32bit machine, or worse, to not emit legitimate warnings. Fix this by passing the appropriate -m32/-m64 flag to sparse. Signed-off-by: Luc Van Oostenryck --- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/a

[PATCH] sh: pass machine size to sparse

2018-05-28 Thread Luc Van Oostenryck
ix this by passing to sparse the appropriate -m32/-m64 flag Signed-off-by: Luc Van Oostenryck --- arch/sh/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 65300193b..3a195c9d5 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -206,6 +206

[PATCH] kbuild: add endianness flag to CHEKCFLAGS

2018-05-28 Thread Luc Van Oostenryck
ernel was configured by adding -m{big,little}-endian to CHECKFLAGS in the main Makefile (and so for all archs). Also, remove the equivalent done in arch specific Makefiles. Signed-off-by: Luc Van Oostenryck --- Makefile | 3 +++ arch/openrisc/Makefile | 1 - arch/parisc/Makefile

Re: [PATCH] kbuild: add endianness flag to CHEKCFLAGS

2018-05-28 Thread Luc Van Oostenryck
On Mon, May 28, 2018 at 10:31:58AM -0700, Randy Dunlap wrote: > On 05/28/2018 10:00 AM, Luc Van Oostenryck wrote: > > +# insure the checker run with the right endianness > > +CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig,-mlittle) > > Does this need to be

[PATCH v2] kbuild: add endianness flag to CHEKCFLAGS

2018-05-28 Thread Luc Van Oostenryck
ernel was configured by adding -m{big,little}-endian to CHECKFLAGS in the main Makefile (and so for all archs). Also, remove the equivalent done in arch specific Makefiles. Signed-off-by: Luc Van Oostenryck --- Makefile | 3 +++ arch/openrisc/Makefile | 1 - arch/parisc/Makefile

Re: [PATCH 3/3] riscv: fix __user annotation for __copy_user()

2018-06-04 Thread Luc Van Oostenryck
On Mon, Jun 04, 2018 at 11:46:50AM -0700, Atish Patra wrote: > On 6/1/18 8:22 AM, Luc Van Oostenryck wrote: > > __copy_user() is a function, written in assembly, used to copy > > memory between kernel & user space. As such its to & from args > > may both take a use

Re: [PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-05 Thread Luc Van Oostenryck
On Tue, Feb 05, 2019 at 10:53:31AM +0100, Rasmus Villemoes wrote: > On 05/02/2019 00.12, Andrew Morton wrote: > >> > >> It would be (very) nice to actually use this macro in a few places so > >> it gets its build testing while in -next. > > > > ie, just about every BUILD_BUG_ON in mm/ could use th

Re: [PATCH v10 00/12] arm64: untag user pointers passed to the kernel

2019-02-26 Thread Luc Van Oostenryck
7;m not sure if it's > possible apply a __tagged/__untagged kind of attribute to non-pointer > types, is it? > > [1] https://patchwork.kernel.org/patch/10581535/ It's something that should need to be added to sparse since it's different from what sparse already have (the existing __bitwise and concept of address-space doesn't seem to do the job here). -- Luc Van Oostenryck

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 inserti

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

2021-02-26 Thread Luc Van Oostenryck
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] [v2] linux/compiler-clang.h: define HAVE_BUILTIN_BSWAP*

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

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 Horne

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 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

[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

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 addres

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

2020-08-07 Thread Luc Van Oostenryck
are_and_swap() 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: [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: [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 > > > logica

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 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"

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

2021-01-23 Thread Luc Van Oostenryck
ssing __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 chang

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, perhap

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 the const

Re: [PATCH] include/linux/hugetlb.h: Convert to use vm_fault_t

2019-03-19 Thread Luc Van Oostenryck
n. This is the expected behaviour. The constant 0 is magic regarding bitwise types but ({ ...; 0; }) is not, it is just an ordinary expression of type 'int'. So, IMHO, Souptick's patch is the right thing to do. Best regards, -- Luc Van Oostenryck

Re: checkpatch warnings in sched.h

2019-09-30 Thread Luc Van Oostenryck
On Fri, Sep 20, 2019 at 02:34:46AM -0500, Steve French wrote: > Any hints to get rid of the noisy warnings in sched.h that make it > hard to spot real warnings: > > /include/linux/sched.h:609:43: error: bad integer constant expression > /include/linux/sched.h:609:73: error: invalid named zero-widt

Re: Many unexpected warnings with current sparse

2019-10-01 Thread Luc Van Oostenryck
ame result. If you're using an older version of sparse, please upgrade. Otherwise, please send me your config so that I can take a look at it. Best regards, -- Luc Van Oostenryck

Re: Many unexpected warnings with current sparse

2019-10-01 Thread Luc Van Oostenryck
On Tue, Oct 01, 2019 at 06:14:23PM -0500, Steve French wrote: > It may be related to the following sparse make warning: > > No rule to make target > '/usr/include/x86_64-linux-gnu/bits/huge_val.h', needed by > 'sparse-llvm.o' > > I don't see huge_val.h in the Ubuntu 19 version of libc6-dev Yes,

Re: Many unexpected warnings with current sparse

2019-10-01 Thread Luc Van Oostenryck
On Tue, Oct 01, 2019 at 08:24:45PM -0500, Steve French wrote: > On Tue, Oct 1, 2019 at 7:19 PM Luc Van Oostenryck > wrote: > > > > On Tue, Oct 01, 2019 at 06:14:23PM -0500, Steve French wrote: > > > It may be related to the following sparse make warning: > &g

Re: [PATCH] riscv: resolve most warnings from sparse

2019-09-26 Thread Luc Van Oostenryck
her pointless, I wonder if there is a way > to just shut up sparse on them. Same for most of head.h. The pseudo-specifier '__visible' (for __attribute__((__externally_visible__))) is defined for this. Best regards, -- Luc Van Oostenryck

Re: sparse warnings on undeclared asmlinkage

2019-10-11 Thread Luc Van Oostenryck
On Fri, Oct 11, 2019 at 05:18:58PM +0100, Ben Dooks wrote: > I was reviewing the sparse output for the current kernel release and > note there are a number of warnings about un-declared functions which > are only used for code in assembly. > > I was wondering if we should just ignore those, and ha

Re: [PATCH 3/8] riscv: init: merge split string literals in preprocessor directive

2019-10-17 Thread Luc Van Oostenryck
ck : #error "blablablablablablablablablablablabla" \ "and blablabla again" Or if need I cn fix Sparse if needed and desiable. Best regards -- Luc Van Oostenryck

Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Luc Van Oostenryck
el=medlow > + CHECKFLAGS += -D__riscv_cmodel_medlow > endif > ifeq ($(CONFIG_CMODEL_MEDANY),y) > KBUILD_CFLAGS += -mcmodel=medany > + CHECKFLAGS += -D__riscv_cmodel_medany I can teach sparse about this in the following days. -- Luc Van Oostenryck

Re: [PATCH 5/8] riscv: add missing prototypes

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 05:49:26PM -0700, Paul Walmsley wrote: > sparse identifies these missing prototypes when building arch/riscv: > > arch/riscv/kernel/cpu.c:149:29: warning: symbol 'cpuinfo_op' was not > declared. Should it be static? > arch/riscv/kernel/irq.c:27:29: warning: symbol 'do_IRQ'

Re: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 09:39:29PM -0700, Paul Walmsley wrote: > On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > > On Thu, Oct 17, 2019 at 05:49:25PM -0700, Paul Walmsley wrote: > > > ifeq ($(CONFIG_CMODEL_MEDANY),y) > > > KBUILD_CFLAGS += -mcmode

Re: [PATCH 3/8] riscv: init: merge split string literals in preprocessor directive

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 09:38:18PM -0700, Paul Walmsley wrote: > On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > > > On Thu, Oct 17, 2019 at 05:49:24PM -0700, Paul Walmsley wrote: > > > sparse complains loudly when string literals associated with > > > preproce

Re: [PATCH 3/8] riscv: init: merge split string literals in preprocessor directive

2019-10-17 Thread Luc Van Oostenryck
On Thu, Oct 17, 2019 at 09:38:18PM -0700, Paul Walmsley wrote: > On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > > > On Thu, Oct 17, 2019 at 05:49:24PM -0700, Paul Walmsley wrote: > > > sparse complains loudly when string literals associated with > > > preproce

Re: sparse: __pure declaration only

2019-10-19 Thread Luc Van Oostenryck
On Fri, Oct 18, 2019 at 08:31:48AM -0700, Linus Torvalds wrote: > On Fri, Oct 18, 2019 at 4:15 AM Ben Dooks wrote: > > > > is this a valid warning? if not, should sparse be ignoring these. > > It's technically valid, but maybe it's not useful. > > If we make sure that any pure bits from a declar

[PATCH] relay: fix percpu annotation in struct rchan

2019-01-18 Thread Luc Van Oostenryck
verify got struct sched_domain ** CC: Akash Goel CC: Jens Axboe CC: Andrew Morton CC: Thomas Gleixner CC: linux-kernel@vger.kernel.org Fixes: 017c59c04 ("relay: Use per CPU constructs for the relay channel buffer pointers") Signed-off-by: Luc Van Oostenryck --- include/linux/

[PATCH] sched/topology: fix percpu in struct sd_data & struct s_data

2019-01-18 Thread Luc Van Oostenryck
eref] *__vpp_verify got struct sched_domain ** CC: Ingo Molnar CC: Peter Zijlstra CC: linux-kernel@vger.kernel.org Signed-off-by: Luc Van Oostenryck --- include/linux/sched/topology.h | 8 kernel/sched/topology.c| 2 +- 2 files changed, 5 insertions(+), 5 deleti

[PATCH] thermal/intel_powerclamp: fix __percpu declaration of worker_data

2019-01-19 Thread Luc Van Oostenryck
igned-off-by: Luc Van Oostenryck --- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index 7571f7c2e..c7cba20bd 100644 --- a/drivers/thermal/

[PATCH] nft_counter: remove wrong __percpu of nft_counter_resest()'s arg

2019-01-19 Thread Luc Van Oostenryck
from the argument's declaration. Signed-off-by: Luc Van Oostenryck --- net/netfilter/nft_counter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nft_counter.c b/net/netfilter/nft_counter.c index a61d7edfc..1a6b06ce6 100644 --- a/net/netfilter/nft_coun

Re: [PATCH v2 3/4] x86/fpu: Fix __user annotations

2019-03-29 Thread Luc Van Oostenryck
put_user_ex(restorer, &frame->pretcode); > + put_user_ex((unsigned long __force)restorer, &frame->pretcode); Same here. Best regards, -- Luc Van Oostenryck

Re: [PATCH] trace: events: fix error directive in argument list

2019-03-29 Thread Luc Van Oostenryck
ocessing directives, the behavior is undefined. [C90 6.8.3, C99 & C11 6.10.3p11] GCC can handle it (and sparse too) but yes sparse complains about it. -- Luc Van Oostenryck

Re: [PATCH] trace: events: fix error directive in argument list

2019-03-29 Thread Luc Van Oostenryck
else > *p32 = 0; > > -#if IS_ENABLED(CONFIG_IPV6) > - if (n->tbl->family == AF_INET6) { > - pin6 = (struct in6_addr *)__entry->primary_key6; Same here. -- Luc Van Oostenryck

Re: [PATCH] trace: events: fix error directive in argument list

2019-03-30 Thread Luc Van Oostenryck
On Sat, Mar 30, 2019 at 04:37:48PM +0530, Hariprasad Kelam wrote: > On Sat, Mar 30, 2019 at 12:22:17AM +0100, Luc Van Oostenryck wrote: > > On Tue, Mar 26, 2019 at 01:23:03AM +0530, Hariprasad Kelam wrote: > > > This patch fixes below spare errors. > > > > >

Re: [PATCH v2] trace: events: fix error directive in argument list

2019-03-30 Thread Luc Van Oostenryck
mily == AF_INET6) { > to if (IS_ENABLED(CONFIG_IPV6) && n->tbl->family == AF_INET6) > > Signed-off-by: Hariprasad Kelam Thanks, Reviewed-by: Luc Van Oostenryck -- Luc

Re: [PATCH v2 0/4] RCU fixes for rcu_assign_pointer() usage

2019-03-21 Thread Luc Van Oostenryck
On Wed, Mar 20, 2019 at 08:34:22PM -0400, Joel Fernandes (Google) wrote: > This is just a resend with scheduler patches split from the driver fixes and > Paul's Reviewed-by(s) added. > > These patches fix various sparse errors ccaused as a result of the recent > check > to add rcu_check_sparse()

  1   2   3   4   >