mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
tty: use assign_bit() where applicable
Convert open-coded if/else with set_bit/clear_bit and their non-atomic __set_bit/__clear_bit variants to the assign_bit/__assign_bit API. Done with Coccinelle semantic patch. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260918141842.3023147-1-peng.fan@oss.nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3f4e628905
commit
857f31656f
|
|
@ -138,10 +138,7 @@ static int pty_set_lock(struct tty_struct *tty, int __user *arg)
|
|||
|
||||
if (get_user(val, arg))
|
||||
return -EFAULT;
|
||||
if (val)
|
||||
set_bit(TTY_PTY_LOCK, &tty->flags);
|
||||
else
|
||||
clear_bit(TTY_PTY_LOCK, &tty->flags);
|
||||
assign_bit(TTY_PTY_LOCK, &tty->flags, val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -911,10 +911,7 @@ static bool sysrq_handle_keypress(struct sysrq_state *sysrq,
|
|||
* keyboard state so we can release keys that have been
|
||||
* pressed before entering SysRq mode.
|
||||
*/
|
||||
if (value)
|
||||
set_bit(code, sysrq->key_down);
|
||||
else
|
||||
clear_bit(code, sysrq->key_down);
|
||||
assign_bit(code, sysrq->key_down, value);
|
||||
|
||||
if (was_active)
|
||||
schedule_work(&sysrq->reinject_work);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user