Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 607480 | Differences between
and this patch

Collapse All | Expand All

(-)4.9.9-gentoo/build/include/linux/compiler.h (+12 lines)
Lines 299-304 Link Here
299
 * with an explicit memory barrier or atomic instruction that provides the
299
 * with an explicit memory barrier or atomic instruction that provides the
300
 * required ordering.
300
 * required ordering.
301
 */
301
 */
302
#ifndef __cplusplus
302
303
303
#define __READ_ONCE(x, check)						\
304
#define __READ_ONCE(x, check)						\
304
({									\
305
({									\
Lines 309-314 Link Here
309
		__read_once_size_nocheck(&(x), __u.__c, sizeof(x));	\
310
		__read_once_size_nocheck(&(x), __u.__c, sizeof(x));	\
310
	__u.__val;							\
311
	__u.__val;							\
311
})
312
})
313
#else
314
#define __READ_ONCE(x, check)						\
315
({									\
316
	union { typeof(x) __val; char __c[1]={0}; } __u;		\
317
	if (check)							\
318
		__read_once_size(&(x), __u.__c, sizeof(x));		\
319
	else								\
320
		__read_once_size_nocheck(&(x), __u.__c, sizeof(x));	\
321
	__u.__val;							\
322
})
323
#endif
312
#define READ_ONCE(x) __READ_ONCE(x, 1)
324
#define READ_ONCE(x) __READ_ONCE(x, 1)
313
325
314
/*
326
/*

Return to bug 607480