• A
    [elf][regset] simplify thread list handling in fill_note_info() · 4b0e21d6
    Al Viro 提交于
    fill_note_info() iterates through the list of threads collected in
    mm->core_state->dumper, allocating a struct elf_thread_core_info
    instance for each and linking those into a list.
    
    We need the entry corresponding to current to be first in the
    resulting list, so the logics for list insertion is
    	if it's for current or list is empty
    		insert in the head
    	else
    		insert after the first element
    
    However, in mm->core_state->dumper the entry for current is guaranteed
    to be the first one.  Which means that both parts of condition will
    be true on the first iteration and neither will be true on all subsequent
    ones.
    
    Taking the first iteration out of the loop simplifies things nicely...
    Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
    4b0e21d6
binfmt_elf.c 61.5 KB