binder: split up binder_update_page_range()
authorCarlos Llamas <cmllamas@google.com>
Fri, 1 Dec 2023 17:21:39 +0000 (17:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2023 00:23:39 +0000 (09:23 +0900)
commit0d35bf3bf2da8d43fd12fea7699dc936999bf96e
treeda9d7105fc1d7d6819700ae709b178a7cbc4fe56
parentdf9aabead791d7a3d59938abe288720f5c1367f7
binder: split up binder_update_page_range()

The binder_update_page_range() function performs both allocation and
freeing of binder pages. However, these two operations are unrelated and
have no common logic. In fact, when a free operation is requested, the
allocation logic is skipped entirely. This behavior makes the error path
unnecessarily complex. To improve readability of the code, this patch
splits the allocation and freeing operations into separate functions.

No functional changes are introduced by this patch.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-11-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder_alloc.c