diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-08-26 10:19:13 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-26 10:19:13 +0300 |
commit | 413d63d71b222108d19703f3fd5cf9108652a730 (patch) | |
tree | 4680de6aebb6430dc5f3d9327f86d65149e6b5ae /drivers/media/usb/rainshadow-cec/rainshadow-cec.c | |
parent | d6c8103b0265d8db30e20e948a4f06382bbdaea7 (diff) | |
parent | 90a6cd503982bfd33ce8c70eb49bd2dd33bc6325 (diff) | |
download | linux-413d63d71b222108d19703f3fd5cf9108652a730.tar.xz |
Merge branch 'linus' into x86/mm to pick up fixes and to fix conflicts
Conflicts:
arch/x86/kernel/head64.c
arch/x86/mm/mmap.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/media/usb/rainshadow-cec/rainshadow-cec.c')
-rw-r--r-- | drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c index f203699e9c1b..65692576690f 100644 --- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c +++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c @@ -116,21 +116,19 @@ static void rain_irq_work_handler(struct work_struct *work) while (true) { unsigned long flags; - bool exit_loop = false; char data; spin_lock_irqsave(&rain->buf_lock, flags); - if (rain->buf_len) { - data = rain->buf[rain->buf_rd_idx]; - rain->buf_len--; - rain->buf_rd_idx = (rain->buf_rd_idx + 1) & 0xff; - } else { - exit_loop = true; + if (!rain->buf_len) { + spin_unlock_irqrestore(&rain->buf_lock, flags); + break; } - spin_unlock_irqrestore(&rain->buf_lock, flags); - if (exit_loop) - break; + data = rain->buf[rain->buf_rd_idx]; + rain->buf_len--; + rain->buf_rd_idx = (rain->buf_rd_idx + 1) & 0xff; + + spin_unlock_irqrestore(&rain->buf_lock, flags); if (!rain->cmd_started && data != '?') continue; |