diff options
author | Jiri Slaby <jslaby@suse.cz> | 2020-02-19 09:49:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-19 12:46:48 +0100 |
commit | 5677fcf376d5d129510f995efd8e77ef31ddf7d2 (patch) | |
tree | a7cbb31a6afd6962cf3e44f50983fb145c8bab16 /drivers | |
parent | d8ca4ecf8dbd22728ce9f36cd76cc7702f76f297 (diff) |
n_gsm: switch dead to bool
Both gsm_dlci->dead and gsm_mux->dead are used as bools, so treat them
as such.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200219084949.28074-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/n_gsm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 8afe635a04fd..24ce46e4fb45 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -140,7 +140,7 @@ struct gsm_dlci { int prev_adaption; u32 modem_rx; /* Our incoming virtual modem lines */ u32 modem_tx; /* Our outgoing modem lines */ - int dead; /* Refuse re-open */ + bool dead; /* Refuse re-open */ /* Flow control */ int throttled; /* Private copy of throttle state */ int constipated; /* Throttle status for outgoing */ @@ -232,7 +232,7 @@ struct gsm_mux { unsigned int mru; unsigned int mtu; int initiator; /* Did we initiate connection */ - int dead; /* Has the mux been shut down */ + bool dead; /* Has the mux been shut down */ struct gsm_dlci *dlci[NUM_DLCI]; int constipated; /* Asked by remote to shut up */ @@ -1207,8 +1207,8 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, struct gsm_dlci *dlci = gsm->dlci[0]; /* Modem wishes to close down */ if (dlci) { - dlci->dead = 1; - gsm->dead = 1; + dlci->dead = true; + gsm->dead = true; gsm_dlci_begin_close(dlci); } } @@ -1434,7 +1434,7 @@ static void gsm_dlci_close(struct gsm_dlci *dlci) tty_port_tty_hangup(&dlci->port, false); kfifo_reset(&dlci->fifo); } else - dlci->gsm->dead = 1; + dlci->gsm->dead = true; wake_up(&dlci->gsm->event); /* A DLCI 0 close is a MUX termination so we need to kick that back to userspace somehow */ @@ -2081,7 +2081,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm) struct gsm_dlci *dlci = gsm->dlci[0]; struct gsm_msg *txq, *ntxq; - gsm->dead = 1; + gsm->dead = true; spin_lock(&gsm_mux_lock); for (i = 0; i < MAX_MUX; i++) { @@ -2098,7 +2098,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm) del_timer_sync(&gsm->t2_timer); /* Now we are sure T2 has stopped */ if (dlci) - dlci->dead = 1; + dlci->dead = true; /* Free up any link layer users */ mutex_lock(&gsm->mutex); @@ -2152,7 +2152,7 @@ static int gsm_activate_mux(struct gsm_mux *gsm) dlci = gsm_dlci_alloc(gsm, 0); if (dlci == NULL) return -ENOMEM; - gsm->dead = 0; /* Tty opens are now permissible */ + gsm->dead = false; /* Tty opens are now permissible */ return 0; } @@ -2236,7 +2236,7 @@ static struct gsm_mux *gsm_alloc_mux(void) gsm->encoding = 1; gsm->mru = 64; /* Default to encoding 1 so these should be 64 */ gsm->mtu = 64; - gsm->dead = 1; /* Avoid early tty opens */ + gsm->dead = true; /* Avoid early tty opens */ return gsm; } |