Francois Romieu wrote:
Fat removal in init_dma_queue - no path allows adapter->dmaq{1/2}.buffer to be != NULL when init_dma_queue() is called; - unneeded memset: pci_alloc_consistent() already zeroes pages; - init_dma_queue_one() avoids some code duplication. +static int init_dma_queue(struct adapter *adapter) +{ + struct { + struct dmaq *dmaq; + u32 dma_status; + int size; + } dmaq_desc[] = { + { &adapter->dmaq1, SIZE_OF_BUF_DMA1, 0x10000000 }, + { &adapter->dmaq2, SIZE_OF_BUF_DMA2, 0x20000000 } + }, *p = dmaq_desc;
In dmaq_desc the dma_status and size are not initialized correctly. Should be reversed: dmaq_desc[] = { { &adapter->dmaq1, 0x10000000, SIZE_OF_BUF_DMA1 }, { &adapter->dmaq2, 0x20000000, SIZE_OF_BUF_DMA2 } };