staging: comedi: ni_660x: fix memory barrier without comment
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:37 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Fix the checkpatch.pl issue. Move the memory barrier to a better place.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_660x.c

index 2926d265f0bdf0ada57ddcd1ec79c074d2ef9534..bb5b5ff4e32f795e5422bafa200c215dba93cf83 100644 (file)
@@ -613,9 +613,11 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d)
 
        if (!dev->attached)
                return IRQ_NONE;
+       /* make sure dev->attached is checked before doing anything else */
+       smp_mb();
+
        /* lock to avoid race with comedi_poll */
        spin_lock_irqsave(&devpriv->interrupt_lock, flags);
-       smp_mb();
        for (i = 0; i < dev->n_subdevices; ++i) {
                s = &dev->subdevices[i];
                if (s->type == COMEDI_SUBD_COUNTER)