net-misc/r8168 emerge with 3.15 kernel results in the following error: CC [M] /var/tmp/portage/net-misc/r8168-8.038.00/work/r8168-8.038.00/src/r8168_n.o /var/tmp/portage/net-misc/r8168-8.038.00/work/r8168-8.038.00/src/r8168_n.c: In function ‘rtl8168_schedule_work’: /var/tmp/portage/net-misc/r8168-8.038.00/work/r8168-8.038.00/src/r8168_n.c:19122:5: error: implicit declaration of function ‘PREPARE_DELAYED_WORK’ [-Werror=implicit-function-declaration] PREPARE_DELAYED_WORK(&tp->task, task); ^ cc1: some warnings being treated as errors scripts/Makefile.build:318: recipe for target '/var/tmp/portage/net-misc/r8168-8.038.00/work/r8168-8.038.00/src/r8168_n.o' failed ------------ There seems to be something regarding this here: https://aur.archlinux.org/packages/r8168-all/?setlang=de Reproducible: Always Steps to Reproduce: 1. Install gentoo-sources-3.15 2. emerge net-misc/r8168 with 3.15 sources being selected
Created attachment 378702 [details, diff] Expand PREPARE_DELAYED_WORK macro inline This is due to the removal of the PREPARE_{,DELAYED_}_WORK macros in the 3.15 kernel: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=f073f9229ff1137d3be20558bec3bfb77e3af2a4. The attached patch uses the commit named above to expand the macro inline. I have verified that the driver successfully builds and runs on my machine with the patch. Someone a lot smarter than me will have to judge whether or not this is actually the right approach.
Well i don't have the hardware anymore so it's really hard to anything about this package. I haven't found another dev with this hardware.
I have access to a machine with this network card where I could test things. Just let me know what you want me to test (should I try the patch/ebuild and see if it works?).
From the looks of it, there's nothing to distinguish the PREPARE_WORK and PREPARE_DELAYED_WORK macros, they are equivalent. With that in mind, why not just replace it with the PREPARE_WORK macro and prevent all the uglier dereferencing? I've seen other suggestions to use INIT_DELAYED_WORK but that macro actually does something functionally different. It actually sets some timer parameters inside the work item.
ahh my bad, it looks like that preprocessor macro was removed too.
Created attachment 382822 [details, diff] s/PREPARE_WORK/INIT_WORK in kernels >= 3.15.0 Adding another patch to swap PREPARE_WORK for INIT_WORK. Adam Stylinski is right that this isn't a functional 1-1 equivalence, but it's how Arch handles it and it seems to work OK on my machine. I've just added directives to only swap macros in kernel versions where it's needed.
The patch works, now it would be nice if the ebuild accepted user patches.
Should no longer be a problem in 8.039.00. Closing.