virtio: console: Fix early_put_chars usage

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, April 7, 2010 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/162a689a13ed61c0752726edb75427b2cd4186c1
Commit:     162a689a13ed61c0752726edb75427b2cd4186c1
Parent:     9a82446bd269b130a9ac270e720e65c3843d4d0c
Author:     François Diakhaté <fdiakh@gmail.com>
AuthorDate: Tue Mar 23 18:23:15 2010 +0530
Committer:  Rusty Russell <rusty@rustcorp.com.au>
CommitDate: Thu Apr 8 09:46:15 2010 +0930

    virtio: console: Fix early_put_chars usage
    
    Currently early_put_chars is not used by virtio_console because it can
    only be used once a port has been found, at which point it's too late
    because it is no longer needed. This patch should fix it.
    
    Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/char/virtio_console.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 026ea6c..48306bc 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -646,13 +646,13 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 {
 	struct port *port;
 
+	if (unlikely(early_put_chars))
+		return early_put_chars(vtermno, buf, count);
+
 	port = find_port_by_vtermno(vtermno);
 	if (!port)
 		return 0;
 
-	if (unlikely(early_put_chars))
-		return early_put_chars(vtermno, buf, count);
-
 	return send_buf(port, (void *)buf, count);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
virtio: console: Fix early_put_chars usage, Linux Kernel Mailing ..., (Wed Apr 7, 6:59 pm)