From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942289AbdEYNBY (ORCPT ); Thu, 25 May 2017 09:01:24 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:36337 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765915AbdEYM71 (ORCPT ); Thu, 25 May 2017 08:59:27 -0400 X-IronPort-Anti-Spam-Filtered: false From: "Levin, Alexander (Sasha Levin)" X-IronPort-AV: E=Sophos;i="5.38,391,1491264000"; d="scan'208";a="1453195170" To: "mingo@kernel.org" CC: "linux-kernel@vger.kernel.org" , "ben@decadent.org.uk" , "a.p.zijlstra@chello.nl" , "tglx@linutronix.de" Subject: [PATCH 19/21] tools include: add IS_ERR_OR_NULL to err.h Thread-Topic: [PATCH 19/21] tools include: add IS_ERR_OR_NULL to err.h Thread-Index: AQHS1VarHmRf5KV0p06IpSPlEZAIuA== Date: Thu, 25 May 2017 12:58:56 +0000 Message-ID: <20170525130005.5947-20-alexander.levin@verizon.com> References: <20170525130005.5947-1-alexander.levin@verizon.com> In-Reply-To: <20170525130005.5947-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v4PD28qu004093 Signed-off-by: Sasha Levin --- 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 bdc3dd8131d4..abf0478a8fb2 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 */ -- 2.11.0