Commit bee70008 authored by Peter Maydell's avatar Peter Maydell Committed by Riku Voipio
Browse files

linux-user: remove unnecessary local from __get_user(), __put_user()



Remove an unnecessary local variable from the __get_user() and
__put_user() macros. This avoids confusing compilation failures
if the name of the local variable ('size') happens to be the
same as the variable the macro user is trying to read/write.
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRiku Voipio <riku.voipio@nokia.com>
parent 48e15fc2
......@@ -264,8 +264,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size)
*/
#define __put_user(x, hptr)\
({\
int size = sizeof(*hptr);\
switch(size) {\
switch(sizeof(*hptr)) {\
case 1:\
*(uint8_t *)(hptr) = (uint8_t)(typeof(*hptr))(x);\
break;\
......@@ -286,8 +285,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size)
#define __get_user(x, hptr) \
({\
int size = sizeof(*hptr);\
switch(size) {\
switch(sizeof(*hptr)) {\
case 1:\
x = (typeof(*hptr))*(uint8_t *)(hptr);\
break;\
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment