TTY: serial, use atomic_inc_return in ioc4_serial
authorJiri Slaby <jslaby@suse.cz>
Mon, 5 Mar 2012 13:52:08 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Mar 2012 19:47:01 +0000 (11:47 -0800)
We want to know the value of the atomic variable in intr_connect after
the increment. But atomic_inc doesn't, per definition, return the
value.  It is just a pure coincidence that ia64 defines atomic_inc as
atomic_inc_return.

So fix this mistake by using atomic_inc_return properly.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/ioc4_serial.c

index 6b36c1554d7eaf2f9c39fa296a26febd55a84d4e..dfec69a310ab1b3f6280eac4cef2074b48f6f056 100644 (file)
@@ -975,7 +975,7 @@ intr_connect(struct ioc4_soft *soft, int type,
        BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
               || (type == IOC4_OTHER_INTR_TYPE)));
 
-       i = atomic_inc(&soft-> is_intr_type[type].is_num_intrs) - 1;
+       i = atomic_inc_return(&soft-> is_intr_type[type].is_num_intrs) - 1;
        BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
 
        /* Save off the lower level interrupt handler */