]> 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>
Thu, 15 Sep 2011 00:38:13 +0000 (10:38 +1000)
commit7e97c3fb2c832498c6cd0f4dbd00b4a8b3585e4c
tree4a3a4077054deda5ecccbf5187bad0cd59479289
parent2d19fa1d14716d498037740a21f9bbe2502fd43d
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