Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2016 11:30:56 +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: r299663 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201605131130.u4DBUu3o018926@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri May 13 11:30:56 2016
New Revision: 299663
URL: https://svnweb.freebsd.org/changeset/base/299663

Log:
  Add unlikely() statement to optimise the IS_ERR_VALUE() macro.
  
  Obtained from:	kmacy @
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/err.h

Modified: head/sys/compat/linuxkpi/common/include/linux/err.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/err.h	Fri May 13 11:27:49 2016	(r299662)
+++ head/sys/compat/linuxkpi/common/include/linux/err.h	Fri May 13 11:30:56 2016	(r299663)
@@ -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)



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