Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2016 07:33:49 +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: r300835 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201605270733.u4R7XnGM053263@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri May 27 07:33:49 2016
New Revision: 300835
URL: https://svnweb.freebsd.org/changeset/base/300835

Log:
  The SCHEDULER_STOPPED() macro already contains a predict false statement.
  Remove superfluous unlikely() wrapper.
  
  Suggested by:	glebius
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/wait.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/wait.h	Fri May 27 07:29:31 2016	(r300834)
+++ head/sys/compat/linuxkpi/common/include/linux/wait.h	Fri May 27 07:33:49 2016	(r300835)
@@ -82,7 +82,7 @@ do {									\
 	void *c = &(q).wchan;						\
 	if (!(cond)) {							\
 		for (;;) {						\
-			if (unlikely(SCHEDULER_STOPPED()))		\
+			if (SCHEDULER_STOPPED())			\
 				break;					\
 			sleepq_lock(c);					\
 			if (cond) {					\
@@ -103,7 +103,7 @@ do {									\
 	_error = 0;							\
 	if (!(cond)) {							\
 		for (; _error == 0;) {					\
-			if (unlikely(SCHEDULER_STOPPED()))		\
+			if (SCHEDULER_STOPPED())			\
 				break;					\
 			sleepq_lock(c);					\
 			if (cond) {					\
@@ -128,7 +128,7 @@ do {									\
 									\
 	if (!(cond)) {							\
 		for (; __rc == 0;) {					\
-			if (unlikely(SCHEDULER_STOPPED()))		\
+			if (SCHEDULER_STOPPED())			\
 				break;					\
 			sleepq_lock(c);					\
 			if (cond) {					\

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Fri May 27 07:29:31 2016	(r300834)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Fri May 27 07:33:49 2016	(r300835)
@@ -1096,7 +1096,7 @@ linux_complete_common(struct completion 
 long
 linux_wait_for_common(struct completion *c, int flags)
 {
-	if (unlikely(SCHEDULER_STOPPED()))
+	if (SCHEDULER_STOPPED())
 		return (0);
 
 	if (flags != 0)
@@ -1128,7 +1128,7 @@ linux_wait_for_timeout_common(struct com
 {
 	long end = jiffies + timeout;
 
-	if (unlikely(SCHEDULER_STOPPED()))
+	if (SCHEDULER_STOPPED())
 		return (0);
 
 	if (flags != 0)



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