virtio: console: make get_inbuf() return port->inbuf if present
authorAmit Shah <amit.shah@redhat.com>
Wed, 14 Sep 2011 07:36:43 +0000 (13:06 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Nov 2011 01:11:00 +0000 (11:41 +1030)
commitd25a9ddae93ca97aa03fdab1363baf0e0c35d960
treefea9bd4041716248fdfd8db78bab715f1d907670
parentdefde66996476295dc7b1b60ea318965f8c3ad86
virtio: console: make get_inbuf() return port->inbuf if present

Instead of pulling in a buffer from the vq each time it's called,
get_inbuf() now checks if the current active buffer, in port->inbuf is
valid.  If it is, just returns a pointer to it.  This ends up
simplifying a lot of code calling get_inbuf() since the check for
port->inbuf being valid was done by all the callers.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c