]> git.karo-electronics.de Git - karo-tx-linux.git/commit
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)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 1 Nov 2011 00:15:25 +0000 (11:15 +1100)
commita103022537e1df37379cf656e3b3ba5788eab6c4
tree623e2cce501287fbd1facfc063de5be240e5b8c8
parent22b1f9effffa03e670d100507cd50e3faa041124
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