From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbdFEJO4 (ORCPT ); Mon, 5 Jun 2017 05:14:56 -0400 Received: from terminus.zytor.com ([65.50.211.136]:56627 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbdFEJOz (ORCPT ); Mon, 5 Jun 2017 05:14:55 -0400 Date: Mon, 5 Jun 2017 02:11:22 -0700 From: "tip-bot for Levin, Alexander (Sasha Levin)" Message-ID: Cc: alexander.levin@verizon.com, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org Reply-To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, alexander.levin@verizon.com In-Reply-To: <20170525130005.5947-20-alexander.levin@verizon.com> References: <20170525130005.5947-20-alexander.levin@verizon.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] tools/include: Add IS_ERR_OR_NULL to err.h Git-Commit-ID: 61d4595eed163ea416c13c4b994f22190711151b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 61d4595eed163ea416c13c4b994f22190711151b Gitweb: http://git.kernel.org/tip/61d4595eed163ea416c13c4b994f22190711151b Author: Levin, Alexander (Sasha Levin) AuthorDate: Thu, 25 May 2017 12:58:56 +0000 Committer: Ingo Molnar CommitDate: Mon, 5 Jun 2017 09:28:12 +0200 tools/include: Add IS_ERR_OR_NULL to err.h Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: a.p.zijlstra@chello.nl Cc: ben@decadent.org.uk Link: http://lkml.kernel.org/r/20170525130005.5947-20-alexander.levin@verizon.com Signed-off-by: Ingo Molnar --- tools/include/linux/err.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h index bdc3dd8..abf0478 100644 --- a/tools/include/linux/err.h +++ b/tools/include/linux/err.h @@ -46,4 +46,9 @@ static inline bool __must_check IS_ERR(__force const void *ptr) return IS_ERR_VALUE((unsigned long)ptr); } +static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) +{ + return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); +} + #endif /* _LINUX_ERR_H */