[PATCH 1/4] fix kfifo miss use of nozami.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: stefani
Date: Monday, August 9, 2010 - 11:40 pm

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.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] fix kfifo miss use of nozami.c, stefani, (Mon Aug 9, 11:40 pm)
Re: [PATCH 1/4] fix kfifo miss use of nozami.c, Alan Cox, (Tue Aug 10, 1:45 am)