err.h: add __must_check to error pointer handlers
authorJani Nikula <ext-jani.1.nikula@nokia.com>
Mon, 24 May 2010 21:33:00 +0000 (14:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 May 2010 15:07:02 +0000 (08:07 -0700)
commite47103b1af5df52fa69e18b14d3012472f78817d
tree6652e56e361415a85ab5a7b888492e5ceef0cd94
parent1f85f87d4f81d1e5a2d502d48316a1bdc5acac0b
err.h: add __must_check to error pointer handlers

Add __must_check to error pointer handlers to have the compiler warn about
mistakes like:

if (err)
ERR_PTR(err);

It found two bugs:

Mar 12 Nikula Jani [PATCH] enclosure: fix error path - actually return ERR_PTR() on error
Mar 12 Nikula Jani [PATCH] sunrpc: fix error path - actually return ERR_PTR() on error

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/err.h