All of lore.kernel.org
 help / color / mirror / Atom feed
* Dereferencing semaphores and atomic_t's
@ 2002-10-02 10:16 Russell King
  2002-10-02 10:32 ` David S. Miller
  2002-10-02 13:21 ` Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Russell King @ 2002-10-02 10:16 UTC (permalink / raw)
  To: linux-kernel

drivers/scsi/scsi_error.c:

        SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent %d\n",
                                          shost->eh_notify->count.counter));

        up(shost->eh_notify);

drivers/scsi/hosts.c:

                up(shost->eh_wait);
                SCSI_LOG_ERROR_RECOVERY(5, printk("Waking error handler"
                                          "thread (%d)\n",
                                          atomic_read(&shost->eh_wait->count)));


                up(shost->eh_wait);
                SCSI_LOG_ERROR_RECOVERY(5, printk("Waking error handler"
                                          "thread (%d)\n",
                                          atomic_read(&shost->eh_wait->count)));

Do we really allow this type of layering violation?

(There appear to be some circumstances when obtaining the semaphore count is
useful, but shouldn't we provide an architecture helper function to do that
since a semaphore structure _is_ an architecture-defined opaque structure.)

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-02 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-02 10:16 Dereferencing semaphores and atomic_t's Russell King
2002-10-02 10:32 ` David S. Miller
2002-10-02 13:21 ` Alan Cox
2002-10-02 16:46   ` Mike Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.