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

Commit 6917237f authored by Sultan Alsawaf's avatar Sultan Alsawaf Committed by KakatkarAkshay
Browse files

simple_lmk: Remove unnecessary clean-up when timeout is reached



Zeroing out the mm struct pointers when the timeout is hit isn't needed
because mm_free_lock prevents any readers from accessing the mm struct
pointers while clean-up occurs, and since the simple_lmk_mm_freed() loop
bound is set to zero during clean-up, there is no possibility of dying
processes ever reading stale mm struct pointers.

Therefore, it is unnecessary to clear out the mm struct pointers when
the timeout is reached. Now the only step to do when the timeout is
reached is to re-init the completion, but since reinit_completion() just
sets a struct member to zero, call reinit_completion() unconditionally
as it is faster than encapsulating it within a conditional statement.

Also take this opportunity to rename some variables and tidy up some
code indentation.

Signed-off-by: default avatarSultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: default avatarDanny Lin <danny@kdrag0n.dev>
parent 53635f49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment