svn commit: r289575 - head/sys/ofed/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Mon Oct 19 12:00:53 UTC 2015


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)
 {


More information about the svn-src-all mailing list