diff options
author | Jiri Slaby <jslaby@suse.cz> | 2020-02-19 09:41:11 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-21 10:24:33 +0100 |
commit | 0f2382981442504d6b92fc300312646aaa5fd6b3 (patch) | |
tree | 2e673e9bf31b357a004be7a1a7c36ba72ee30220 /drivers/tty/n_hdlc.c | |
parent | edee649f9d278e322ff107ce8d2539522b76a388 (diff) | |
download | linux-stable-0f2382981442504d6b92fc300312646aaa5fd6b3.tar.gz linux-stable-0f2382981442504d6b92fc300312646aaa5fd6b3.tar.bz2 linux-stable-0f2382981442504d6b92fc300312646aaa5fd6b3.zip |
n_hdlc: switch tbusy and woke_up to bools
They are in fact bools, so save some bytes (8B on x86_64). Also describe
@woke_up as we know what it is.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200219084118.26491-17-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_hdlc.c')
-rw-r--r-- | drivers/tty/n_hdlc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index 615abe582cac..c4fe09124185 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -125,7 +125,7 @@ struct n_hdlc_buf_list { * struct n_hdlc - per device instance data structure * @magic - magic value for structure * @tbusy - reentrancy flag for tx wakeup code - * @woke_up - FIXME: describe this field + * @woke_up - tx wakeup needs to be run again as it was called while @tbusy * @tx_buf_list - list of pending transmit frame buffers * @rx_buf_list - list of received frame buffers * @tx_free_buf_list - list unused transmit frame buffers @@ -133,8 +133,8 @@ struct n_hdlc_buf_list { */ struct n_hdlc { int magic; - int tbusy; - int woke_up; + bool tbusy; + bool woke_up; struct n_hdlc_buf_list tx_buf_list; struct n_hdlc_buf_list rx_buf_list; struct n_hdlc_buf_list tx_free_buf_list; @@ -275,12 +275,12 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock, flags); if (n_hdlc->tbusy) { - n_hdlc->woke_up = 1; - spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); + n_hdlc->woke_up = true; + spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); return; } - n_hdlc->tbusy = 1; - n_hdlc->woke_up = 0; + n_hdlc->tbusy = true; + n_hdlc->woke_up = false; spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); @@ -332,7 +332,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) /* Clear the re-entry flag */ spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock, flags); - n_hdlc->tbusy = 0; + n_hdlc->tbusy = false; spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock, flags); if (n_hdlc->woke_up) |