Am 02.11.2015 um 16:16 schrieb Joerg Roedel:
> On Fri, Oct 30, 2015 at 02:20:35PM +0100, Christian Borntraeger wrote:
>> +static void *dma_noop_alloc(struct device *dev, size_t size,
>> + dma_addr_t *dma_handle, gfp_t gfp,
>> + struct dma_attrs *attrs)
>> +{
>> + void *ret;
>> +
>> + ret = (void *)__get_free_pages(gfp, get_order(size));
>> + if (ret) {
>> + memset(ret, 0, size);
>
> There is no need to zero out the memory here. If the user wants
> initialized memory it can call dma_zalloc_coherent. Having the memset
> here means to clear the memory twice in the dma_zalloc_coherent path.
>
> Otherwise it looks good.
Thanks. Will fix.
In addition I will also make the compilation of dma-noop.o dependent
on HAS_DMA.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html