lkml.org 
[lkml]   [2016]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [GIT PULL] kbuild updates for v4.7-rc1
From
On Fri, May 27, 2016 at 10:23 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> This code:
>
> if (IS_ERR(hash))
> return PTR_ERR(hash);
>
> is obviously "return non-zero" to a kernel developer (because that's
> how our error codes work), but to a compiler that "return PTR_ERR()"
> ends up casting a "long" to an "int" return value.

It doesn't help that gfs2 is using the IS_ERR_VALUE() macro on an
"int", whih is bogus to begin with. It happens to *work*, but by the
time you've cast an error pointer to "int", you've lost enough bits
that "IS_ERR_VALUE()" isn't a valid thing to do. You should just check
against zero (possibly against negative).

But fixing that and just checking against a non-zero int doesn't
actually fix the warning.

Linus

\
 
 \ /
  Last update: 2016-05-27 20:41    [W:0.127 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site