]> 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>
Mon, 24 Oct 2011 20:12:24 +0000 (07:12 +1100)
commita7fcdb11f4f75836ad6a1523a67a70eb538450b0
tree4ee1def7f06c7692a8fa907de9785119457a98ce
parente74e8f867c4e2456608b7653b26900201b810ed0
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