All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH] ASoC: Intel: Fix block offset calculations.
Date: Fri,  2 May 2014 16:56:28 +0100	[thread overview]
Message-ID: <1399046194-5544-2-git-send-email-liam.r.girdwood@linux.intel.com> (raw)
In-Reply-To: <1399046194-5544-1-git-send-email-liam.r.girdwood@linux.intel.com>

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(-)

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;
 
-- 
1.9.1

  reply	other threads:[~2014-05-02 15:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 15:56 [PATCH] ASoC: Intel: Fix block allocation so we only allocate blocks once Liam Girdwood
2014-05-02 15:56 ` Liam Girdwood [this message]
2014-05-02 16:52   ` [PATCH] ASoC: Intel: Fix block offset calculations Mark Brown
2014-05-02 15:56 ` [PATCH] ASoC: Intel: Fix allocated block list usage when adding blocks Liam Girdwood
2014-05-02 16:53   ` Mark Brown
2014-05-02 15:56 ` [PATCH] ASoC: Intel: Fix Haswell/Broadwell DSP page table creation Liam Girdwood
2014-05-02 16:53   ` Mark Brown
2014-05-02 15:56 ` [PATCH] ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled Liam Girdwood
2014-05-02 16:53   ` Mark Brown
2014-05-02 15:56 ` [PATCH] ASoC: Intel: Fix allow hw_params to be called more than once Liam Girdwood
2014-05-02 16:53   ` Mark Brown
2014-05-02 15:56 ` [PATCH] ASoC: Intel: Fix stream position pointer Liam Girdwood
2014-05-02 16:54   ` Mark Brown
2014-05-02 16:52 ` [PATCH] ASoC: Intel: Fix block allocation so we only allocate blocks once Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399046194-5544-2-git-send-email-liam.r.girdwood@linux.intel.com \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.