summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-05-13 11:30:56 +0000
committerhselasky <hselasky@FreeBSD.org>2016-05-13 11:30:56 +0000
commit8582824c7b51bd8586edd1f35e40f1b14d801001 (patch)
tree105d2392c2ff5a113b376d96a711c39a8d37e3b7
parenteb49c6802f80f6cdf4bfa5e19615f5249d7137e0 (diff)
downloadFreeBSD-src-8582824c7b51bd8586edd1f35e40f1b14d801001.zip
FreeBSD-src-8582824c7b51bd8586edd1f35e40f1b14d801001.tar.gz
Add unlikely() statement to optimise the IS_ERR_VALUE() macro.
Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
-rw-r--r--sys/compat/linuxkpi/common/include/linux/err.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/err.h b/sys/compat/linuxkpi/common/include/linux/err.h
index 2366130..a976932 100644
--- a/sys/compat/linuxkpi/common/include/linux/err.h
+++ b/sys/compat/linuxkpi/common/include/linux/err.h
@@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,9 +31,11 @@
#ifndef _LINUX_ERR_H_
#define _LINUX_ERR_H_
+#include <linux/compiler.h>
+
#define MAX_ERRNO 4095
-#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
static inline void *
ERR_PTR(long error)
OpenPOWER on IntegriCloud