This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature is different in 5.1 and 5.2 still. In order to support both we have to define the signature of both versions here too and add a proper if around them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it seems like the
vm_fault_t (*fault)(struct vm_fault *vmf);
signature was changed in kernel 4.17, and hasn't been changed after that, in mainline at least.torvalds/linux@1c8f422
With the following patch to anbox-modules-dkms version 13 the module builds in both 5.1.15 and 5.4.12 for me.
--- binder/binder.c.orig 2020-01-17 14:08:56.306373591 +0100
+++ binder/binder.c 2020-01-17 14:09:23.078508434 +0100
@@ -3367,7 +3367,9 @@
binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES);
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+static vm_fault_t binder_vm_fault(struct vm_fault *vmf)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
static int binder_vm_fault(struct vm_fault *vmf)
#else
static int binder_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)