Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664663 > unrolled thread

./include/linux/err.h:35:16: warning: dereference of noderef expression

Started byCharlemagne Lasse <charlemagnelasse@gmail.com>
First post2017-06-13 12:00 +0200
Last post2017-06-13 12:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  ./include/linux/err.h:35:16: warning: dereference of noderef expression Charlemagne Lasse <charlemagnelasse@gmail.com> - 2017-06-13 12:00 +0200
    Re: ./include/linux/err.h:35:16: warning: dereference of noderef  expression Luc Van Oostenryck <luc.vanoostenryck@gmail.com> - 2017-06-13 12:50 +0200

#1664663 — ./include/linux/err.h:35:16: warning: dereference of noderef expression

FromCharlemagne Lasse <charlemagnelasse@gmail.com>
Date2017-06-13 12:00 +0200
Subject./include/linux/err.h:35:16: warning: dereference of noderef expression
Message-ID<tRQMb-6li-21@gated-at.bofh.it>
Hi,

I have following code which generates a warning when compiling with "make C=1".

~~~~~~~
struct task_struct *kthread;
kthread = kthread_create(xxxxx, yyyyy, "zzzzz");
if (IS_ERR(kthread)) {
~~~~~~~

The warning is

    ./include/linux/err.h:35:16: warning: dereference of noderef expression

And disappears when I remove the IS_ERR. How do I correctly work
around this incorrect warning?

Btw. I am using Debian stretch amd64. It seems like this is related to
the __force used in the parameter list of IS_ERR. Removing it also
removes the warning.

If it is fixed in sparse's git then when will there be a new release of it?

Greetings,
Charlemagne Lasse

[toc] | [next] | [standalone]


#1664739 — Re: ./include/linux/err.h:35:16: warning: dereference of noderef expression

FromLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Date2017-06-13 12:50 +0200
SubjectRe: ./include/linux/err.h:35:16: warning: dereference of noderef expression
Message-ID<tRRyx-6SG-3@gated-at.bofh.it>
In reply to#1664663
On Tue, Jun 13, 2017 at 11:55:26AM +0200, Charlemagne Lasse wrote:
> Hi,
> 
> I have following code which generates a warning when compiling with "make C=1".
> 
> ~~~~~~~
> struct task_struct *kthread;
> kthread = kthread_create(xxxxx, yyyyy, "zzzzz");
> if (IS_ERR(kthread)) {
> ~~~~~~~
> 
> The warning is
> 
>     ./include/linux/err.h:35:16: warning: dereference of noderef expression
> 
> And disappears when I remove the IS_ERR. How do I correctly work
> around this incorrect warning?
> 
> Btw. I am using Debian stretch amd64. It seems like this is related to
> the __force used in the parameter list of IS_ERR. Removing it also
> removes the warning.

The warning is indeed related to '__force' but it should be
the other way around.
Anyway, by just reading your three lines of code, you shouldn't
receive this warning, with or without the __force.
 
> If it is fixed in sparse's git then when will there be a new release of it?

I can't reproduce your problem even on a three years old version
of sparse (more exactly git version d917662d5 of sparse, anything
older has build problems with half-recent kernels).

The pre-processed version of your file could be interesting
as well as the output of the make command but with the 'V=1'
option added.
 

Regards,
-- Luc Van Oostenryck

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web