]> 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 23:04:26 +0000 (10:04 +1100)
commitb298a9e8f10ab188914ff96b0edbf3ea47d72ab2
tree4a1e78a5b19f961084745295598b7e2b4e98586a
parent071e453fbb8b94cd8af04700a5e3f75d5b41c9bb
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