Messages in this thread | | | Date | Fri, 27 May 2016 11:28:48 -0700 | Subject | Re: [GIT PULL] kbuild updates for v4.7-rc1 | From | Linus Torvalds <> |
| |
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
| |