Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755849AbYLDPus (ORCPT ); Thu, 4 Dec 2008 10:50:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754536AbYLDPud (ORCPT ); Thu, 4 Dec 2008 10:50:33 -0500 Received: from rn-out-0910.google.com ([64.233.170.189]:6742 "EHLO rn-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbYLDPub (ORCPT ); Thu, 4 Dec 2008 10:50:31 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=hLnVPIm5l5HvAED/dWGRaKhMHxWIZGK6MtLSYxlujENBzBZLulkn1MURP9Q247/CW1 BTIpm4X0a5RL5/89rYRFhWrZw8nfN+yunIBpfZYzyYGSxcS91WVRnk7tWWXNNqqRk6h5 9Gr7OXOc691ETnetciDQljbBw0QEopnk+G4h8= Message-ID: <87a5b0800812040750p6231b0c9s2f664345b23596f0@mail.gmail.com> Date: Thu, 4 Dec 2008 15:50:29 +0000 From: "Will Newton" To: "Alan Cox" Subject: Re: [PATCH] tty: Flags should be accessed via the foo_bit interfaces Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20081204154030.27980.82380.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081204154030.27980.82380.stgit@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2607 Lines: 61 On Thu, Dec 4, 2008 at 3:41 PM, Alan Cox wrote: > From: Alan Cox > > 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 > 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/