From owner-svn-src-all@freebsd.org Mon Oct 19 12:00:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766A3A19CBE; Mon, 19 Oct 2015 12:00:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 404E1F73; Mon, 19 Oct 2015 12:00:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9JC0q3d070338; Mon, 19 Oct 2015 12:00:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9JC0qqa070337; Mon, 19 Oct 2015 12:00:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510191200.t9JC0qqa070337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Oct 2015 12:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289575 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 12:00:53 -0000 Author: hselasky Date: Mon Oct 19 12:00:52 2015 New Revision: 289575 URL: https://svnweb.freebsd.org/changeset/base/289575 Log: Implement IS_ERR_OR_NULL() function. Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/err.h Modified: head/sys/ofed/include/linux/err.h ============================================================================== --- head/sys/ofed/include/linux/err.h Mon Oct 19 11:57:33 2015 (r289574) +++ head/sys/ofed/include/linux/err.h Mon Oct 19 12:00:52 2015 (r289575) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,12 @@ IS_ERR(const void *ptr) return IS_ERR_VALUE((unsigned long)ptr); } +static inline long +IS_ERR_OR_NULL(const void *ptr) +{ + return !ptr || IS_ERR_VALUE((unsigned long)ptr); +} + static inline void * ERR_CAST(void *ptr) {