kernel/kexec_file.c: remove unneeded for-loop in kexec_purgatory_setup_sechdrs
authorPhilipp Rudo <[email protected]>
Fri, 13 Apr 2018 22:36:32 +0000 (15:36 -0700)
committerLinus Torvalds <[email protected]>
Sat, 14 Apr 2018 00:10:28 +0000 (17:10 -0700)
commitf1b1cca39650c9c1dbe26140946a518953f66771
treeec9b5b836fa82cd7956f01ec4f40ad66d51dc165
parent930457057abe4e6d57433dea75e97e0e39fd0ab6
kernel/kexec_file.c: remove unneeded for-loop in kexec_purgatory_setup_sechdrs

To update the entry point there is an extra loop over all section
headers although this can be done in the main loop.  So move it there
and eliminate the extra loop and variable to store the 'entry section
index'.

Also, in the main loop, move the usual case, i.e.  non-bss section, out
of the extra if-block.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Philipp Rudo <[email protected]>
Reviewed-by: Martin Schwidefsky <[email protected]>
Acked-by: Dave Young <[email protected]>
Cc: AKASHI Takahiro <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Thiago Jung Bauermann <[email protected]>
Cc: Vivek Goyal <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/kexec_file.c