aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-06-04 02:25:33 -0400
committerTakashi Iwai <tiwai@suse.de>2014-06-04 08:35:40 -0400
commitcf44a136c062098b099a44698291e50c5bfdce2e (patch)
treec293a465d18322aa106997be84a2ccfe0b8403ec /sound
parentc6e5e741c6dc8e13a47721f419e26e6ac19ecaf4 (diff)
ALSA: fireworks: Use safer way to arrange ring buffer pointer
To reverse a pointer for the ring buffer, subtraction by buffer size is better than assignment to the beginning of the buffer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/firewire/fireworks/fireworks_hwdep.c2
-rw-r--r--sound/firewire/fireworks/fireworks_transaction.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c
index 4f8216fb6b62..33df8655fe81 100644
--- a/sound/firewire/fireworks/fireworks_hwdep.c
+++ b/sound/firewire/fireworks/fireworks_hwdep.c
@@ -58,7 +58,7 @@ hwdep_read_resp_buf(struct snd_efw *efw, char __user *buf, long remained,
58 efw->pull_ptr += till_end; 58 efw->pull_ptr += till_end;
59 if (efw->pull_ptr >= efw->resp_buf + 59 if (efw->pull_ptr >= efw->resp_buf +
60 snd_efw_resp_buf_size) 60 snd_efw_resp_buf_size)
61 efw->pull_ptr = efw->resp_buf; 61 efw->pull_ptr -= snd_efw_resp_buf_size;
62 62
63 length -= till_end; 63 length -= till_end;
64 buf += till_end; 64 buf += till_end;
diff --git a/sound/firewire/fireworks/fireworks_transaction.c b/sound/firewire/fireworks/fireworks_transaction.c
index aa56b8ac537c..a6a9e9fd66b9 100644
--- a/sound/firewire/fireworks/fireworks_transaction.c
+++ b/sound/firewire/fireworks/fireworks_transaction.c
@@ -148,7 +148,7 @@ copy_resp_to_buf(struct snd_efw *efw, void *data, size_t length, int *rcode)
148 148
149 efw->push_ptr += till_end; 149 efw->push_ptr += till_end;
150 if (efw->push_ptr >= efw->resp_buf + snd_efw_resp_buf_size) 150 if (efw->push_ptr >= efw->resp_buf + snd_efw_resp_buf_size)
151 efw->push_ptr = efw->resp_buf; 151 efw->push_ptr -= snd_efw_resp_buf_size;
152 152
153 length -= till_end; 153 length -= till_end;
154 data += till_end; 154 data += till_end;