Re: [PATCH 22/29] atari_scsi: Fix atari_scsi deadlocks on Falcon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 2, 2014 at 8:56 AM, Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx> wrote:
--- linux.orig/arch/m68k/atari/stdma.c  2014-10-02 16:55:28.000000000 +1000
+++ linux/arch/m68k/atari/stdma.c       2014-10-02 16:56:20.000000000 +1000

-int stdma_others_waiting(void)
+int stdma_is_locked_by(irq_handler_t handler)
 {
-       return waitqueue_active(&stdma_wait);
+       unsigned long flags;
+
+       local_irq_save(flags);
+       if (stdma_locked && (stdma_isr == handler)) {
+               local_irq_restore(flags);
+               return 1;
+       }
+       local_irq_restore(flags);
+       return 0;
 }

This can be written shorter:

int stdma_is_locked_by(irq_handler_t handler)
{
        unsigned long flags;
        int res;

        local_irq_save(flags);
        res = stdma_locked && (stdma_isr == handler);
        local_irq_restore(flags);

        return res;
}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux