ASoC: Intel: Fix block offset calculations.
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>
Fri, 2 May 2014 15:56:28 +0000 (16:56 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 7 May 2014 08:38:29 +0000 (09:38 +0100)
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/intel/sst-firmware.c

index c38cfda8003c9924014bb433d67a7ba0ca4c49b4..928f228c38e754db3f41551208493045ce9ee561 100644 (file)
@@ -244,8 +244,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;
                }
@@ -341,7 +340,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;
 
@@ -368,8 +367,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;