Commit 376c879e authored by Yafang Shao's avatar Yafang Shao Committed by Petr Mladek
Browse files

livepatch: Add comment to clarify klp_add_nops()

Add detailed comments to clarify the purpose of klp_add_nops() function.
These comments are based on Petr's explanation[0].

Link: https://lore.kernel.org/all/Z6XUA7D0eU_YDMVp@pathway.suse.cz/

 [0]
Suggested-by: default avatarPetr Mladek <pmladek@suse.com>
Suggested-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20250227024733.16989-2-laoar.shao@gmail.com


Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent 33608823
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -601,9 +601,12 @@ static int klp_add_object_nops(struct klp_patch *patch,
}

/*
 * Add 'nop' functions which simply return to the caller to run
 * the original function. The 'nop' functions are added to a
 * patch to facilitate a 'replace' mode.
 * Add 'nop' functions which simply return to the caller to run the
 * original function.
 *
 * They are added only when the atomic replace mode is used and only for
 * functions which are currently livepatched but are no longer included
 * in the new livepatch.
 */
static int klp_add_nops(struct klp_patch *patch)
{