Date: Mon, 14 Aug 2017 12:59:14 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322500 - stable/10/sys/ofed/include/linux Message-ID: <201708141259.v7ECxEu5061129@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; \ })
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708141259.v7ECxEu5061129>