Commit 33bb30c3 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman

staging: ccree: simplify buf mgr using local vars

Make the code more readable by using a local variables
for commonly use expressions in the buffer manager part
of the driver.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d30a3969
...@@ -225,16 +225,18 @@ static int cc_generate_mlli( ...@@ -225,16 +225,18 @@ static int cc_generate_mlli(
mlli_p = (u32 *)mlli_params->mlli_virt_addr; mlli_p = (u32 *)mlli_params->mlli_virt_addr;
/* go over all SG's and link it to one MLLI table */ /* go over all SG's and link it to one MLLI table */
for (i = 0; i < sg_data->num_of_buffers; i++) { for (i = 0; i < sg_data->num_of_buffers; i++) {
union buffer_array_entry *entry = &sg_data->entry[i];
u32 tot_len = sg_data->total_data_len[i];
u32 offset = sg_data->offset[i];
if (sg_data->type[i] == DMA_SGL_TYPE) if (sg_data->type[i] == DMA_SGL_TYPE)
rc = cc_render_sg_to_mlli(dev, sg_data->entry[i].sgl, rc = cc_render_sg_to_mlli(dev, entry->sgl, tot_len,
sg_data->total_data_len[i], offset, &total_nents,
sg_data->offset[i], &mlli_p);
&total_nents, &mlli_p);
else /*DMA_BUFF_TYPE*/ else /*DMA_BUFF_TYPE*/
rc = cc_render_buff_to_mlli(dev, rc = cc_render_buff_to_mlli(dev, entry->buffer_dma,
sg_data->entry[i].buffer_dma, tot_len, &total_nents,
sg_data->total_data_len[i], &mlli_p);
&total_nents, &mlli_p);
if (rc != 0) if (rc != 0)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment