Hi Tao,
I would prefer to exchange the if else sequence, to be:
/* The global symbol of vmemmap is removed since kernel commit 7bc1a0f9e1765 */
if (kernel_symbol_exists("vmemmap"))
ms->vmemmap = symbol_value("vmemmap");
else
ms->vmemmap = ms->vmemmap_vaddr - ((ms->phys_offset >>
machdep->pageshift) * ms->struct_page_size);
This would be more readable, if a symbol exists, then read the symbol,
otherwise calc it out.
I agree with your exchange.
Thanks
Qiwu