On 10/12/17 4:30 AM, David Laight wrote:
Isn't the memory allocated by a single kzalloc() call?
dma_alloc_coherenent, actually.
IIRC that guarantees it doesn't cross a power or 2 boundary less than the size.
I'm pretty sure that kzalloc does not make that guarantee, and I don't think dma_alloc_coherent does either.
So if you allocate any size between 4k and 8k it won't cross an odd 4k boundary (etc). So these checks are entirely pointless.
-- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.