提交 5309665d 编写于 作者: C Christoph Lameter 提交者: Tejun Heo

fakekey: Simplify speakup_fake_key_pressed through this_cpu_ops

The whole function can be expressed as a simple this_cpu_read() operation.
The function overhead is now likely multiple times that of the single
instruction that is executed in it.

Sedat: fixed compile failure caused by an extra ')'.

Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: NH. Peter Anvin <hpa@zytor.com>
Signed-off-by: NChristoph Lameter <cl@linux.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 b76834bc
......@@ -95,10 +95,5 @@ void speakup_fake_down_arrow(void)
*/
bool speakup_fake_key_pressed(void)
{
bool is_pressed;
is_pressed = get_cpu_var(reporting_keystroke);
put_cpu_var(reporting_keystroke);
return is_pressed;
return this_cpu_read(reporting_keystroke);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册