On 30/10/2015 13:53, Arnd Bergmann wrote:I tried replacing with dma_map_single, but I feel the code is not as clean as I need to manually set sg_dma_len() and sg_dma_address():
On Monday 26 October 2015 22:14:58 John Garry wrote:
+ /*
+ * DMA-map SMP request, response buffers
+ */
+ /* req */
+ sg_req = &task->smp_task.smp_req;
+ elem = dma_map_sg(dev, sg_req, 1, DMA_TO_DEVICE);
+ if (!elem)
+ return -ENOMEM;
+ req_len = sg_dma_len(sg_req);
+ req_dma_addr = sg_dma_address(sg_req);
If you only use the first element, could you just use dma_map_single()?
Can do. Actually sg_req seems only ever has one element:
expander.c, smp_execute_task()
sg_init_one(&task->smp_task.smp_req, req, req_size);
_______________________________________________
linuxarm mailing list
linuxarm@xxxxxxxxxx
http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
.