MIPS: Make access_ok() sideeffect proof.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Ralf Baechle 2009-04-27 15:31:34 +02:00
Родитель 1699e5c9c4
Коммит d0aab922b1
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -105,10 +105,20 @@
#define __access_mask get_fs().seg
#define __access_ok(addr, size, mask) \
(((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0)
({ \
const volatile void __user *__up = addr; \
unsigned long __addr = (unsigned long) __up; \
unsigned long __size = size; \
unsigned long __mask = mask; \
unsigned long __ok; \
\
__ok = (signed long)(__mask & (__addr | (__addr + __size) | \
__ua_size(__size))); \
__ok == 0; \
})
#define access_ok(type, addr, size) \
likely(__access_ok((unsigned long)(addr), (size), __access_mask))
likely(__access_ok((addr), (size), __access_mask))
/*
* put_user: - Write a simple value into user space.