Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 512842 - net-misc/r8168 with kernel 3.15 - .../work/r8168-8.038.00/src/r8168_n.c:19122:5: error: implicit declaration of function ‘PREPARE_DELAYED_WORK’ [-Werror=implicit-function-declaration]
Summary: net-misc/r8168 with kernel 3.15 - .../work/r8168-8.038.00/src/r8168_n.c:19122...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-09 20:30 UTC by Daniel Kenzelmann
Modified: 2015-03-24 22:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Expand PREPARE_DELAYED_WORK macro inline (r8168-kernel-3.15.patch,785 bytes, patch)
2014-06-11 12:53 UTC, erikjwaxx
Details | Diff
s/PREPARE_WORK/INIT_WORK in kernels >= 3.15.0 (r8168-kernel-3.15.patch,752 bytes, patch)
2014-08-13 12:46 UTC, erikjwaxx
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kenzelmann 2014-06-09 20:30:23 UTC
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
Comment 1 erikjwaxx 2014-06-11 12:53:47 UTC
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.
Comment 2 Christian Birchinger (RETIRED) gentoo-dev 2014-06-14 21:45:18 UTC
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.
Comment 3 Daniel Kenzelmann 2014-06-15 09:24:15 UTC
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?).
Comment 4 Adam Stylinski 2014-07-17 14:46:32 UTC
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.
Comment 5 Adam Stylinski 2014-07-17 14:47:39 UTC
ahh my bad, it looks like that preprocessor macro was removed too.
Comment 6 erikjwaxx 2014-08-13 12:46:58 UTC
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.
Comment 7 Sven Eden 2014-09-24 08:02:13 UTC
The patch works, now it would be nice if the ebuild accepted user patches.
Comment 8 James Le Cuirot gentoo-dev 2015-03-24 22:56:19 UTC
Should no longer be a problem in 8.039.00. Closing.