Skip to content

Commit

Permalink
[TIPC]: Fix headercheck wrt. tipc_config.h
Browse files Browse the repository at this point in the history
It wants string functions like memcpy() for inline
routines, and these define userland interfaces.

The only clean way to deal with this is to simply
put linux/string.h into unifdef-y and have it
include <string.h> when not-__KERNEL__.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 31, 2007
1 parent f3baa48 commit 97ef1bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ unifdef-y += sonypi.h
unifdef-y += soundcard.h
unifdef-y += stat.h
unifdef-y += stddef.h
unifdef-y += string.h
unifdef-y += synclink.h
unifdef-y += sysctl.h
unifdef-y += tcp.h
Expand Down
12 changes: 3 additions & 9 deletions include/linux/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

/* We don't want strings.h stuff being user by user stuff by accident */

#ifdef __KERNEL__
#ifndef __KERNEL__
#include <string.h>
#else

#include <linux/compiler.h> /* for inline */
#include <linux/types.h> /* for size_t */
#include <linux/stddef.h> /* for NULL */

#ifdef __cplusplus
extern "C" {
#endif

extern char *strndup_user(const char __user *, long);

/*
Expand Down Expand Up @@ -111,9 +109,5 @@ extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
extern void argv_free(char **argv);

#ifdef __cplusplus
}
#endif

#endif
#endif /* _LINUX_STRING_H_ */

0 comments on commit 97ef1bb

Please sign in to comment.