LinuxKPI: fix -Wunused-but-set-variable warnings
Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107
(cherry picked from commit 7043359ce3c1e56ed55c8b41867a14a418511a05)