提交 c84ef530 编写于 作者: A Andi Kleen 提交者: Andi Kleen

[PATCH] Use early clobber in semaphores

New code clobbers the result always early, so tell gcc about it
Signed-off-by: NAndi Kleen <ak@suse.de>
上级 34596dc9
...@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem) ...@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
"jns 2f\n\t" "jns 2f\n\t"
"call __down_failed_interruptible\n" "call __down_failed_interruptible\n"
"2:\n" "2:\n"
:"=a" (result), "=m" (sem->count) :"=&a" (result), "=m" (sem->count)
:"D" (sem) :"D" (sem)
:"memory"); :"memory");
return result; return result;
...@@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem)
"jns 2f\n\t" "jns 2f\n\t"
"call __down_failed_trylock\n\t" "call __down_failed_trylock\n\t"
"2:\n" "2:\n"
:"=a" (result), "=m" (sem->count) :"=&a" (result), "=m" (sem->count)
:"D" (sem) :"D" (sem)
:"memory","cc"); :"memory","cc");
return result; return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册