Commit bab1ff1b authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: UHCI: Use ACCESS_ONCE rather than using a full compiler barrier

This patch (as1462) updates the special accessor functions defined in
uhci-hcd.h.  Rather than using a full compiler barrier, all we really
need is the ACCESS_ONCE() mechanism, because the idea is to force the
compiler to store a fixed copy of a possibly changing value.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8452c674
...@@ -168,12 +168,7 @@ struct uhci_qh { ...@@ -168,12 +168,7 @@ struct uhci_qh {
* We need a special accessor for the element pointer because it is * We need a special accessor for the element pointer because it is
* subject to asynchronous updates by the controller. * subject to asynchronous updates by the controller.
*/ */
static inline __le32 qh_element(struct uhci_qh *qh) { #define qh_element(qh) ACCESS_ONCE((qh)->element)
__le32 element = qh->element;
barrier();
return element;
}
#define LINK_TO_QH(qh) (UHCI_PTR_QH | cpu_to_le32((qh)->dma_handle)) #define LINK_TO_QH(qh) (UHCI_PTR_QH | cpu_to_le32((qh)->dma_handle))
...@@ -263,12 +258,7 @@ struct uhci_td { ...@@ -263,12 +258,7 @@ struct uhci_td {
* We need a special accessor for the control/status word because it is * We need a special accessor for the control/status word because it is
* subject to asynchronous updates by the controller. * subject to asynchronous updates by the controller.
*/ */
static inline u32 td_status(struct uhci_td *td) { #define td_status(td) le32_to_cpu(ACCESS_ONCE((td)->status))
__le32 status = td->status;
barrier();
return le32_to_cpu(status);
}
#define LINK_TO_TD(td) (cpu_to_le32((td)->dma_handle)) #define LINK_TO_TD(td) (cpu_to_le32((td)->dma_handle))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment