diff mbox

ASoC: Intel: Fix block offset calculations.

Message ID 1399046194-5544-2-git-send-email-liam.r.girdwood@linux.intel.com (mailing list archive)
State Accepted
Commit 2b39aab18a84b2fa348d42d894ef986b290d67a0
Headers show

Commit Message

Liam Girdwood May 2, 2014, 3:56 p.m. UTC
Block offset calculations are done in the contiguous allocator so
are not required here.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 sound/soc/intel/sst-firmware.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Mark Brown May 2, 2014, 4:52 p.m. UTC | #1
On Fri, May 02, 2014 at 04:56:28PM +0100, Liam Girdwood wrote:
> Block offset calculations are done in the contiguous allocator so
> are not required here.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index c4e7126..fb5d084 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -247,8 +247,7 @@  static int block_alloc(struct sst_module *module,
 		/* do we span > 1 blocks */
 		if (data->size > block->size) {
 			ret = block_alloc_contiguous(module, data,
-				block->offset + block->size,
-				data->size - block->size);
+				block->offset, data->size);
 			if (ret == 0)
 				return ret;
 		}
@@ -344,7 +343,7 @@  static int block_alloc_fixed(struct sst_module *module,
 
 			err = block_alloc_contiguous(module, data,
 				block->offset + block->size,
-				data->size - block->size + data->offset - block->offset);
+				data->size - block->size);
 			if (err < 0)
 				return -ENOMEM;
 
@@ -371,8 +370,7 @@  static int block_alloc_fixed(struct sst_module *module,
 		if (data->offset >= block->offset && data->offset < block_end) {
 
 			err = block_alloc_contiguous(module, data,
-				block->offset + block->size,
-				data->size - block->size);
+				block->offset, data->size);
 			if (err < 0)
 				return -ENOMEM;