From: "Will Newton" <will.newton@gmail.com>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: Flags should be accessed via the foo_bit interfaces
Date: Thu, 4 Dec 2008 15:50:29 +0000 [thread overview]
Message-ID: <87a5b0800812040750p6231b0c9s2f664345b23596f0@mail.gmail.com> (raw)
In-Reply-To: <20081204154030.27980.82380.stgit@localhost.localdomain>
On Thu, Dec 4, 2008 at 3:41 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> From: Alan Cox <alan@redhat.com>
>
> We have various drivers that poke around directly and we need to clean this
> up before it causes problems. Fix up the networking ones - (Dave can you send
> this via the net tree as that seems simplest)
>
> Signed-off-by: Alan Cox <alan@redhat.com>
> diff --git a/drivers/net/slip.c b/drivers/net/slip.c
> index 1d58991..951c7df 100644
> --- a/drivers/net/slip.c
> +++ b/drivers/net/slip.c
> @@ -402,7 +402,7 @@ static void sl_encaps(struct slip *sl, unsigned char *icp, int len)
> * if we did not request it before write operation.
> * 14 Oct 1994 Dmitry Gorodchanin.
> */
> - sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
> + set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
> actual = sl->tty->ops->write(sl->tty, sl->xbuff, count);
> #ifdef SL_CHECK_TRANSMIT
> sl->dev->trans_start = jiffies;
> @@ -432,7 +432,7 @@ static void slip_write_wakeup(struct tty_struct *tty)
> /* Now serial buffer is almost free & we can start
> * transmission of another packet */
> sl->tx_packets++;
> - tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
> + clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
> sl_unlock(sl);
> return;
> }
> @@ -465,7 +465,7 @@ static void sl_tx_timeout(struct net_device *dev)
> (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
> "bad line quality" : "driver error");
> sl->xleft = 0;
> - sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
> + clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
> sl_unlock(sl);
> #endif
> }
> @@ -515,10 +515,9 @@ sl_close(struct net_device *dev)
> struct slip *sl = netdev_priv(dev);
>
> spin_lock_bh(&sl->lock);
> - if (sl->tty) {
> + if (sl->tty)
> + clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
> /* TTY discipline is running. */
> - sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
> - }
The indentation of the comment looks like it might be wrong here.
> netif_stop_queue(dev);
> sl->rcount = 0;
> sl->xleft = 0;
next prev parent reply other threads:[~2008-12-04 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 15:41 Alan Cox
2008-12-04 15:50 ` Will Newton [this message]
2008-12-04 23:04 ` David Miller
2008-12-05 7:08 ` Andrew Morton
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=87a5b0800812040750p6231b0c9s2f664345b23596f0@mail.gmail.com \
--to=will.newton@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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
all inboxes | Powered by JetHome®