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)
commit6162a2edfefa57eaffb425ea5338d75601ffd501
treeaa54bac9457e49aabcb6bb0928eb7fbb85e1ca0e
parent9524ce36a1e36a5c8587e62421e67b89ce0b5697
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