Commit a0b90f50 authored by Gwenhael Goavec-Merou's avatar Gwenhael Goavec-Merou Committed by Juan David González Cobas

spec-sw: kernel: wr-nic-dio: signal_pending is define in linux/sched/signal.h with kernel > 4.11

Since 4.11 signal_pending is declared in linux/sched/signal.h. Using
linux/sched.h result in a build failure :

spec-sw/kernel/wr-nic-dio.c: In function 'wrn_dio_cmd_stamp':
spec-sw/kernel/wr-nic-dio.c:267:7: error: implicit declaration of function 'signal_pending'; did you mean 'timer_pending'? [-Werror=implicit-function-declaration]
   if (signal_pending(current))
       ^~~~~~~~~~~~~~
       timer_pending
cc1: some warnings being treated as errors
make[5]: *** [/usr/src/linux-headers-4.18.0-2-common/scripts/Makefile.build:323: spec-sw/kernel/wr-nic-dio.o] Error 1
make[4]: *** [/usr/src/linux-headers-4.18.0-2-common/Makefile:1531: _module_spec-sw/kernel] Error 2
make[3]: *** [Makefile:146: sub-make] Error 2
make[2]: *** [Makefile:8: all] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.18.0-2-amd64'
make[1]: *** [Makefile:20: all] Error 2
make[1]: Leaving directory 'spec-sw/kernel'
make: *** [Makefile:28: kernel] Error 2

This patch adds preprocessor to include correct head according to the kernel version.
Signed-off-by: 's avatarGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
parent aa8d5d99
......@@ -8,7 +8,12 @@
* by CERN, the European Institute for Nuclear Research.
*/
#include <linux/module.h>
#include <linux/version.h>
#if KERNEL_VERSION(4,11,0) > LINUX_VERSION_CODE
#include <linux/sched.h>
#else
#include <linux/sched/signal.h>
#endif
#include <linux/wait.h>
#include <linux/ktime.h>
#include <linux/atomic.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment