Skip to content

Commit 04b1ce4

Browse files
authored
Merge pull request #517 from mmaka1/hda-size-fixed
dma: hda: Free size computation fixed
2 parents e101263 + d7a6b50 commit 04b1ce4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/drivers/intel/cavs/hda-dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ static inline uint32_t hda_dma_get_data_size(struct dma *dma, uint32_t chan)
162162
const uint32_t rp = host_dma_reg_read(dma, chan, DGBRP);
163163
const uint32_t wp = host_dma_reg_read(dma, chan, DGBWP);
164164

165-
uint32_t ds;
165+
int32_t ds;
166166

167167
if (!(cs & DGCS_BNE))
168168
return 0; /* buffer is empty */
169-
ds = wp - rp;
169+
ds = (int32_t)wp - (int32_t)rp;
170170
if (ds <= 0)
171171
ds += bs;
172172

0 commit comments

Comments
 (0)