batman-adv: fix build against kernels backporting kmalloc_obj
The compat definitions of kzalloc_obj(), kmalloc_obj() and
kmalloc_objs() were guarded by a version range which carves out only
specific stable backports. These helpers are backported on demand to
stable kernel branches, so on a newer stable kernel they collide
with the definitions in include/linux/slab.h and the module fails to
build:
compat-hacks.h:52:9: error: "kzalloc_obj" redefined [-Werror]
./include/linux/slab.h:963:9: note: this is the location of the
previous definition
CI showed this on exactly the four targets sitting on
KERNEL_PATCHVER 6.12 - mips_24kc, powerpc_8548, arm_cortex-a15 and
arm_cortex-a9 - while the six 6.18 targets passed.
Guard each definition on the macro name instead, so the compat code
steps aside whenever the kernel provides the helper, without having
to track which point release of which stable series picked up the
backport.
This mirrors what batman-adv carries in compat-include/linux/slab.h.
That file is not used by this package, which force-includes its own
compat-hacks.h instead, so the same fix has to be applied here as
well. slab.h is included explicitly, because unlike the upstream
file this header does not otherwise pull it in.
Upstream-Status: Backport [
96a26bababe5e9c9b9f9226e7cdbe60f49f57b71]
Signed-off-by: Josef Schlehofer <redacted>
Co-authored-by: Claude Fable 5 <redacted>