binder: fix missing prototype for zap_page_range_single

deps.c implements zap_page_range_single() as a runtime compat shim
(resolved via kallsyms_lookup_name), but deps.h never declared its
prototype, and binder_alloc.c did not include deps.h. Newer compilers
(Clang, building with -std=gnu11 and later defaults) treat an
implicit function declaration as a hard error rather than a warning,
so the module fails to build:

  binder_alloc.c:1029:3: error: call to undeclared function
  'zap_page_range_single'; ISO C99 and later do not support implicit
  function declarations [-Wimplicit-function-declaration]

Declare the prototype in deps.h and include it from binder_alloc.c.

Verified the module builds and links cleanly (binder_linux.ko) against
kernel 7.1.1 with the fix applied; previously failed with the error
above.
This commit is contained in:
PEKKA Chang 2026-06-21 15:20:27 +08:00
parent 17c83fd1d3
commit fb109b5eec
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include "binder_alloc.h"
#include "binder_trace.h"
#include "compat_version.h"
#include "deps.h"
struct list_lru binder_alloc_lru;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/ipc_namespace.h>
#include <linux/mm.h>
struct ipc_namespace* get_init_ipc_ns_ptr(void);
void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
unsigned long size, struct zap_details *details);