From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOTAg-00055R-U1 for barebox@lists.infradead.org; Fri, 14 Mar 2014 14:33:18 +0000 From: Sascha Hauer Date: Fri, 14 Mar 2014 15:32:21 +0100 Message-Id: <1394807569-23620-2-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1394807569-23620-1-git-send-email-s.hauer@pengutronix.de> References: <1394807569-23620-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 01/29] err.h: Add PTR_ERR_OR_ZERO from kernel To: barebox@lists.infradead.org Signed-off-by: Sascha Hauer --- include/linux/err.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/err.h b/include/linux/err.h index 19fb70d..ed563f2 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -52,6 +52,14 @@ static inline void *ERR_CAST(const void *ptr) return (void *) ptr; } +static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) +{ + if (IS_ERR(ptr)) + return PTR_ERR(ptr); + else + return 0; +} + #endif #endif /* _LINUX_ERR_H */ -- 1.9.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox