Skip to content

Commit

Permalink
char: xilinx_devcfg: Fix regression introduced in remove volatile com…
Browse files Browse the repository at this point in the history
…mmit

Commit c390fee
char: xilinx_devcfg: Fix warnings in the driver

removed volatile around dma_done and error_status without further actions.
This fix prevents these variables from being optimized away without being
read.

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Oct 17, 2017
1 parent 57199d6 commit 70ca088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/xilinx_devcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ xdevcfg_write(struct file *file, const char __user *buf, size_t count,

timeout = jiffies + msecs_to_jiffies(1000);

while (!drvdata->dma_done) {
while (!READ_ONCE(drvdata->dma_done)) {
if (time_after(jiffies, timeout)) {
status = -ETIMEDOUT;
goto error;
}
}

if (drvdata->error_status)
if (READ_ONCE(drvdata->error_status))
status = drvdata->error_status;

/* Disable the DMA and error interrupts */
Expand Down

0 comments on commit 70ca088

Please sign in to comment.