linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 09/10] n_gsm: switch constipated to bool
Date: Wed, 19 Feb 2020 09:49:48 +0100	[thread overview]
Message-ID: <20200219084949.28074-9-jslaby@suse.cz> (raw)
In-Reply-To: <20200219084949.28074-1-jslaby@suse.cz>

Both gsm_dlci->constipated and gsm_mux->constipated are used as bools,
so treat them as such.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/n_gsm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 6bd51d309c32..e0283bb24bb5 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -143,7 +143,7 @@ struct gsm_dlci {
 	bool dead;		/* Refuse re-open */
 	/* Flow control */
 	bool throttled;		/* Private copy of throttle state */
-	int constipated;	/* Throttle status for outgoing */
+	bool constipated;	/* Throttle status for outgoing */
 	/* Packetised I/O */
 	struct sk_buff *skb;	/* Frame being sent */
 	struct sk_buff_head skb_list;	/* Queued frames */
@@ -234,7 +234,7 @@ struct gsm_mux {
 	int initiator;			/* Did we initiate connection */
 	bool dead;			/* Has the mux been shut down */
 	struct gsm_dlci *dlci[NUM_DLCI];
-	int constipated;		/* Asked by remote to shut up */
+	bool constipated;		/* Asked by remote to shut up */
 
 	spinlock_t tx_lock;
 	unsigned int tx_bytes;		/* TX data outstanding */
@@ -1042,9 +1042,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
 	fc = (modem & MDM_FC) || !(modem & MDM_RTR);
 	if (fc && !dlci->constipated) {
 		/* Need to throttle our output on this device */
-		dlci->constipated = 1;
+		dlci->constipated = true;
 	} else if (!fc && dlci->constipated) {
-		dlci->constipated = 0;
+		dlci->constipated = false;
 		gsm_dlci_data_kick(dlci);
 	}
 
@@ -1219,7 +1219,7 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
 		break;
 	case CMD_FCON:
 		/* Modem can accept data again */
-		gsm->constipated = 0;
+		gsm->constipated = false;
 		gsm_control_reply(gsm, CMD_FCON, NULL, 0);
 		/* Kick the link in case it is idling */
 		spin_lock_irqsave(&gsm->tx_lock, flags);
@@ -1228,7 +1228,7 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
 		break;
 	case CMD_FCOFF:
 		/* Modem wants us to STFU */
-		gsm->constipated = 1;
+		gsm->constipated = true;
 		gsm_control_reply(gsm, CMD_FCOFF, NULL, 0);
 		break;
 	case CMD_MSC:
-- 
2.25.0


  parent reply	other threads:[~2020-02-19  8:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19  8:49 [PATCH 01/10] n_gsm: drop unneeded gsm_dlci->fifo field Jiri Slaby
2020-02-19  8:49 ` [PATCH 02/10] n_gsm: introduce enum gsm_dlci_state Jiri Slaby
2020-02-19  8:49 ` [PATCH 03/10] n_gsm: introduce enum gsm_dlci_mode Jiri Slaby
2020-02-19  8:49 ` [PATCH 04/10] n_gsm: introduce enum gsm_mux_state Jiri Slaby
2020-02-19  8:49 ` [PATCH 05/10] n_gsm: add missing __user annotations Jiri Slaby
2020-02-19  8:49 ` [PATCH 06/10] n_gsm: add missing \n to prints Jiri Slaby
2020-02-19  8:49 ` [PATCH 07/10] n_gsm: switch dead to bool Jiri Slaby
2020-02-19  8:49 ` [PATCH 08/10] n_gsm: switch throttled " Jiri Slaby
2020-02-19  8:49 ` Jiri Slaby [this message]
2020-02-19  8:49 ` [PATCH 10/10] n_gsm: switch escape " Jiri Slaby
2020-02-20 19:44 ` [PATCH 01/10] n_gsm: drop unneeded gsm_dlci->fifo field Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200219084949.28074-9-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).