Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e8e6c2ec authored by Cesar Eduardo Barros's avatar Cesar Eduardo Barros Committed by Linus Torvalds
Browse files

sys_swapon: do not depend on "type" after allocation



Within sys_swapon, after the swap_info entry has been allocated, we
always have type == p->type and swap_info[type] == p. Use this fact to
reduce the dependency on the "type" local variable within the function,
as a preparation to move the allocation of the swap_info entry to a
separate function.

Signed-off-by: default avatarCesar Eduardo Barros <cesarb@cesarb.net>
Tested-by: default avatarEric B Munson <emunson@mgebm.net>
Acked-by: default avatarEric B Munson <emunson@mgebm.net>
Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
Reviewed-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujisu.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 80b0df12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment