backports: backport-3.15: Include fix
authorRichard Röjfors <richard.rojfors@gmail.com>
Sat, 3 May 2014 14:09:37 +0000 (16:09 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 1 Jun 2014 21:41:08 +0000 (23:41 +0200)
In this version the correct linux string.h is included.

Include string.h to avoid compile issues if warnings are treated as errors:

backports-3.14-1/compat/backport-3.15.c: In function 'backport_devm_kstrdup':
backports-3.14-1/compat/backport-3.15.c:33:2: error: implicit declaration of function 'strlen' [-Werror=implicit-function-declaration]
   size = strlen(s) + 1;
   ^
backports-3.14-1/compat/backport-3.15.c:33:9: warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]
   size = strlen(s) + 1;
          ^
backports-3.14-1/compat/backport-3.15.c:36:3: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
    memcpy(buf, s, size);
    ^
backports-3.14-1/compat/backport-3.15.c:36:3: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]

Signed-off-by: Richard Röjfors <richard@puffinpack.se>
[refreshed patch on current master]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/compat/backport-3.15.c

index 545e0c297ea6b76e45d3316c090ad6053d21ce41..4094e27c1f6ab9e784872958f21ff5468ec44c80 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <linux/of.h>
+#include <linux/string.h>
 #include <net/net_namespace.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))