wcn36xx: use READ_ONCE() to access desc->ctrl
authorDaniel Mack <daniel@zonque.org>
Tue, 10 Apr 2018 17:35:58 +0000 (19:35 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 19 Apr 2018 16:22:43 +0000 (19:22 +0300)
commit9ff6fde86fd27a0c733c01114eb0d46bd3a33fb7
treeaa54bac9457e49aabcb6bb0928eb7fbb85e1ca0e
parent6da2b2d46ff937edc3ecea0a36d92252981d033a
wcn36xx: use READ_ONCE() to access desc->ctrl

When accessing shared memory to check for the stat of submitted
descriptors, make sure to use READ_ONCE(). This will guarantee the
compiler treats these memory locations as volatile and doesn't apply
any caching.

While this doesn't fix any particular problem I ran into, it's best
practice to do it this way.

Note that this patch also removes the superflous extra condition check
in the do-while loop in reap_tx_dxes(), as the loop will break
instantly anyway in that case.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/dxe.c