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

Collapse All | Expand All

(-)a/include/linux/compiler.h (-1 / +12 lines)
Lines 300-305 static __always_inline void __write_once_size(volatile void *p, void *res, int s Link Here
300
 * required ordering.
300
 * required ordering.
301
 */
301
 */
302
302
303
#ifndef __cplusplus
303
#define __READ_ONCE(x, check)						\
304
#define __READ_ONCE(x, check)						\
304
({									\
305
({									\
305
	union { typeof(x) __val; char __c[1]; } __u;			\
306
	union { typeof(x) __val; char __c[1]; } __u;			\
Lines 309-314 static __always_inline void __write_once_size(volatile void *p, void *res, int s 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 { void _u(){}; typeof(x) __val; char __c[1]; } __u={0};	\
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
/*
315
- 

Return to bug 603472