]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Use more readable name for ioport mutex
authorPekka Enberg <penberg@kernel.org>
Thu, 26 May 2011 15:59:59 +0000 (18:59 +0300)
committerPekka Enberg <penberg@kernel.org>
Thu, 26 May 2011 15:59:59 +0000 (18:59 +0300)
This patch renames the mutex in iport.c to 'ioport_mutex' and documents which
data it is used to protect.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/ioport.c

index 492ce1642ae157f8526b1eb7802ccd686ed6f43e..d0a1aa8655f7eebb58afaefbc7983688b3b1110d 100644 (file)
 
 #define ioport_node(n) rb_entry(n, struct ioport, node)
 
-static u16 free_io_port_idx;
-DEFINE_MUTEX(free_io_port_idx_lock);
-static struct rb_root ioport_tree = RB_ROOT;
-bool ioport_debug;
+DEFINE_MUTEX(ioport_mutex);
+
+static u16                     free_io_port_idx; /* protected by ioport_mutex */
+
+static struct rb_root          ioport_tree = RB_ROOT;
+bool                           ioport_debug;
 
 static u16 ioport__find_free_port(void)
 {
        u16 free_port;
 
-       mutex_lock(&free_io_port_idx_lock);
+       mutex_lock(&ioport_mutex);
        free_port = IOPORT_START + free_io_port_idx * IOPORT_SIZE;
        free_io_port_idx++;
-       mutex_unlock(&free_io_port_idx_lock);
+       mutex_unlock(&ioport_mutex);
 
        return free_port;
 }