Re: [PATCH] Staging: goldfish: Add DMA support using dma_alloc_coherent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> unnecessarily used when DMA can do the job. Coherent mapping is
> allocated
> by means of dma_alloc_coherent so that the device and CPU are in
> sync.

It's also not freed 8)

As far as I can see you can replace the devm_kzalloc of cmd->params
with a dma_alloc_coherent, and ensure you free it when the device is
destroyed, rather than allocating a new buffer each command.

You also want dma_handle to be a u64 - dma_handle_t might be 32 or 64
bit and due to a historical (and IMHO dim) bit of design C doesn't
define right or left shifting by >= the size of the type as "0" but as
"undefined".

Alan

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux