aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/ioc4_serial.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 08:52:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 14:47:01 -0500
commit4da2405606d47ca767e0c6ba556f127cfa2181d0 (patch)
treed03cb844398c91ee97980a85a3eee007c184ce0f /drivers/tty/serial/ioc4_serial.c
parent885f8b0f8ab497b8520f95ff3c1bb7efb1c331ac (diff)
TTY: serial, use atomic_inc_return in ioc4_serial
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>
Diffstat (limited to 'drivers/tty/serial/ioc4_serial.c')
-rw-r--r--drivers/tty/serial/ioc4_serial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index 6b36c1554d7e..dfec69a310ab 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -975,7 +975,7 @@ intr_connect(struct ioc4_soft *soft, int type,
975 BUG_ON(!((type == IOC4_SIO_INTR_TYPE) 975 BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
976 || (type == IOC4_OTHER_INTR_TYPE))); 976 || (type == IOC4_OTHER_INTR_TYPE)));
977 977
978 i = atomic_inc(&soft-> is_intr_type[type].is_num_intrs) - 1; 978 i = atomic_inc_return(&soft-> is_intr_type[type].is_num_intrs) - 1;
979 BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0))); 979 BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
980 980
981 /* Save off the lower level interrupt handler */ 981 /* Save off the lower level interrupt handler */