Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 2015 12:00:52 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289575 - head/sys/ofed/include/linux
Message-ID:  <201510191200.t9JC0qqa070337@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510191200.t9JC0qqa070337>