[Buildroot] [git commit branch/next] package/dahdi-linux: fix build with kernel >= 6.1

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Feb 7 13:44:02 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=33bdf7bb037c05863aa69bbe219e1cb78d596a3a
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/next

Fix the following build failure with kernel >= 6.1

In file included from ./include/linux/string.h:20,
                 from ./include/linux/bitmap.h:11,
                 from ./include/linux/cpumask.h:12,
                 from ./include/linux/mm_types_task.h:14,
                 from ./include/linux/mm_types.h:5,
                 from ./include/linux/buildid.h:5,
                 from ./include/linux/module.h:14,
                 from /home/autobuild/autobuild/instance-11/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wctc4xxp/base.c:24:
./arch/powerpc/include/asm/string.h:27:22: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
   27 | extern void * memcpy(void *,const void *,__kernel_size_t);
      |                      ^~~~~~
/home/autobuild/autobuild/instance-11/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wctc4xxp/base.c:661:9: error: too many arguments to function ‘netif_napi_add’
  661 |         netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64);
      |         ^~~~~~~~~~~~~~
In file included from ./include/net/inet_sock.h:19,
                 from ./include/linux/udp.h:16,
                 from /home/autobuild/autobuild/instance-11/output-1/build/dahdi-linux-3.2.0/drivers/dahdi/wctc4xxp/base.c:38:
./include/linux/netdevice.h:2562:1: note: declared here
 2562 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
      | ^~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/d7ce103a886329c68c04ebe05571be8f95a873ce

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 .../0004-next-fix-kernel-6-1-build.patch           | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/package/dahdi-linux/0004-next-fix-kernel-6-1-build.patch b/package/dahdi-linux/0004-next-fix-kernel-6-1-build.patch
new file mode 100644
index 0000000000..b910c4b775
--- /dev/null
+++ b/package/dahdi-linux/0004-next-fix-kernel-6-1-build.patch
@@ -0,0 +1,32 @@
+From a759a578277bde98eba7ef4bf86bdf819a900de9 Mon Sep 17 00:00:00 2001
+From: John Thomson <git at johnthomson.fastmail.com.au>
+Date: Sun, 23 Oct 2022 13:42:52 +1000
+Subject: [PATCH] fix kernel 6.1 build
+
+kernel 6.1 includes b48b89f9c189 ("net: drop the weight argument from netif_napi_add") [0]
+
+[0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d
+
+Signed-off-by: John Thomson <git at johnthomson.fastmail.com.au>
+[Retrieved from:
+https://github.com/asterisk/dahdi-linux/pull/14/commits/a759a578277bde98eba7ef4bf86bdf819a900de9]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+---
+ include/dahdi/kernel.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
+index 35e93bc4..fd64a15e 100644
+--- a/include/dahdi/kernel.h
++++ b/include/dahdi/kernel.h
+@@ -58,6 +58,10 @@
+ 
+ #include <linux/poll.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
++#define netif_napi_add netif_napi_add_weight
++#endif
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ #include <linux/pci.h>
+ #include <linux/dma-mapping.h>



More information about the buildroot mailing list