svn commit: r322500 - stable/10/sys/ofed/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Mon Aug 14 12:59:15 UTC 2017


Author: hselasky
Date: Mon Aug 14 12:59:14 2017
New Revision: 322500
URL: https://svnweb.freebsd.org/changeset/base/322500

Log:
  MFC r314878:
  Add support for constant pointer constructs to READ_ONCE() in the
  LinuxKPI. When the type of the argument is constant the temporary
  variable cannot be assigned after the barrier. Instead assign the
  temporary variable by initialization.
  
  Approved by:		re (kib)
  Sponsored by:		Mellanox Technologies

Modified:
  stable/10/sys/ofed/include/linux/compiler.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ofed/include/linux/compiler.h
==============================================================================
--- stable/10/sys/ofed/include/linux/compiler.h	Mon Aug 14 12:47:16 2017	(r322499)
+++ stable/10/sys/ofed/include/linux/compiler.h	Mon Aug 14 12:59:14 2017	(r322500)
@@ -80,9 +80,10 @@
 } while (0)
 
 #define	READ_ONCE(x) ({			\
-	__typeof(x) __var;		\
-	barrier();			\
-	__var = ACCESS_ONCE(x);		\
+	__typeof(x) __var = ({		\
+		barrier();		\
+		ACCESS_ONCE(x);		\
+	});				\
 	barrier();			\
 	__var;				\
 })


More information about the svn-src-all mailing list