linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: stefani@seibold.net
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	andi@firstfloor.org, gregkh@suse.de, alan@lxorguk.ukuu.org.uk,
	tytso@mit.edu, iws@ovro.caltech.edu
Cc: stefani@seibold.net
Subject: [PATCH 1/4] fix kfifo miss use of nozami.c
Date: Tue, 20 Apr 2010 22:06:37 +0200	[thread overview]
Message-ID: <1271794000-18897-2-git-send-email-stefani@seibold.net> (raw)
In-Reply-To: <1271794000-18897-1-git-send-email-stefani@seibold.net>

From: Stefani Seibold <stefani@seibold.net>

User of the kernel fifo should never bypass the API and directly access
the fifo structure. Otherwise it will be very hard to maintain the API.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
---
 drivers/char/nozomi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index a663800..d578449 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1741,8 +1741,7 @@ static int ntty_write_room(struct tty_struct *tty)
 	if (dc) {
 		mutex_lock(&port->tty_sem);
 		if (port->port.count)
-			room = port->fifo_ul.size -
-					kfifo_len(&port->fifo_ul);
+			room = kfifo_avail(&port->fifo_ul);
 		mutex_unlock(&port->tty_sem);
 	}
 	return room;
-- 
1.7.0.4


  reply	other threads:[~2010-04-20 20:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 20:06 [PATCH 0/4] enhanced reimplemention of the kfifo API stefani
2010-04-20 20:06 ` stefani [this message]
2010-04-20 20:06 ` [PATCH 2/4] add the new generic " stefani
2010-04-20 20:06 ` [PATCH 3/4] replace the old non generic API stefani
2010-04-20 20:06 ` [PATCH 4/4] add example files to the kernel sample directory stefani
2010-04-20 20:16 ` [PATCH 0/4] enhanced reimplemention of the kfifo API Greg KH
2010-04-20 20:35   ` Stefani Seibold
2010-04-20 22:13     ` Greg KH
2010-04-20 20:42   ` Ira W. Snyder
2010-04-20 22:14     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-08-10  6:40 stefani
2010-08-10  6:40 ` [PATCH 1/4] fix kfifo miss use of nozami.c stefani
2010-08-10  8:45   ` Alan Cox
2010-07-20 13:05 [PATCH 0/4] enhanced reimplemention of the kfifo API stefani
2010-07-20 13:05 ` [PATCH 1/4] fix kfifo miss use of nozami.c stefani
2010-05-12  8:49 really generic, type save and type definable stefani
2010-05-12  8:49 ` [PATCH 1/4] fix kfifo miss use of nozami.c stefani
2010-04-18 21:05 [PATCH 0/4] enhanced reimplemention of the kfifo API stefani
2010-04-18 21:05 ` [PATCH 1/4] fix kfifo miss use of nozami.c stefani
2010-04-18 20:54 [PATCH 0/4] enhanced reimplemention of the kfifo API stefani
2010-04-18 20:54 ` [PATCH 1/4] fix kfifo miss use of nozami.c stefani
2010-02-12  7:52 [PATCH 0/4] enhanced reimplemention of the kfifo API Stefani Seibold
2010-02-12  7:56 ` [PATCH 1/4] fix kfifo miss use of nozami.c Stefani Seibold

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=1271794000-18897-2-git-send-email-stefani@seibold.net \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=gregkh@suse.de \
    --cc=iws@ovro.caltech.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).