aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaulo Marques <pmarques@grupopie.com>2005-06-23 03:09:02 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:18 -0400
commit543537bd922692bc978e2e356fcd8bfc9c2ee7d5 (patch)
tree0089e3907e7d6c17c01cffc6ea4a8962ed053079 /include
parent991114c6fa6a21d1fa4d544abe78592352860c82 (diff)
[PATCH] create a kstrdup library function
This patch creates a new kstrdup library function and changes the "local" implementations in several places to use this function. Most of the changes come from the sound and net subsystems. The sound part had already been acknowledged by Takashi Iwai and the net part by David S. Miller. I left UML alone for now because I would need more time to read the code carefully before making changes there. Signed-off-by: Paulo Marques <pmarques@grupopie.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/string.h2
-rw-r--r--include/sound/core.h3
3 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d6afd440cf7b..d89816ad642f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -925,10 +925,6 @@ extern int skb_checksum_help(struct sk_buff *skb, int inward);
925extern void net_enable_timestamp(void); 925extern void net_enable_timestamp(void);
926extern void net_disable_timestamp(void); 926extern void net_disable_timestamp(void);
927 927
928#ifdef CONFIG_SYSCTL
929extern char *net_sysctl_strdup(const char *s);
930#endif
931
932#endif /* __KERNEL__ */ 928#endif /* __KERNEL__ */
933 929
934#endif /* _LINUX_DEV_H */ 930#endif /* _LINUX_DEV_H */
diff --git a/include/linux/string.h b/include/linux/string.h
index b9fc59469956..93994c613095 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -88,6 +88,8 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
88extern void * memchr(const void *,int,__kernel_size_t); 88extern void * memchr(const void *,int,__kernel_size_t);
89#endif 89#endif
90 90
91extern char *kstrdup(const char *s, int gfp);
92
91#ifdef __cplusplus 93#ifdef __cplusplus
92} 94}
93#endif 95#endif
diff --git a/include/sound/core.h b/include/sound/core.h
index 9117c23e3a01..f8c4ef0aa352 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -292,6 +292,7 @@ void *snd_hidden_kcalloc(size_t n, size_t size, int flags);
292void snd_hidden_kfree(const void *obj); 292void snd_hidden_kfree(const void *obj);
293void *snd_hidden_vmalloc(unsigned long size); 293void *snd_hidden_vmalloc(unsigned long size);
294void snd_hidden_vfree(void *obj); 294void snd_hidden_vfree(void *obj);
295char *snd_hidden_kstrdup(const char *s, int flags);
295#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) 296#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
296#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) 297#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
297#define kfree(obj) snd_hidden_kfree(obj) 298#define kfree(obj) snd_hidden_kfree(obj)
@@ -301,6 +302,7 @@ void snd_hidden_vfree(void *obj);
301#define vmalloc_nocheck(size) snd_wrapper_vmalloc(size) 302#define vmalloc_nocheck(size) snd_wrapper_vmalloc(size)
302#define kfree_nocheck(obj) snd_wrapper_kfree(obj) 303#define kfree_nocheck(obj) snd_wrapper_kfree(obj)
303#define vfree_nocheck(obj) snd_wrapper_vfree(obj) 304#define vfree_nocheck(obj) snd_wrapper_vfree(obj)
305#define kstrdup(s, flags) snd_hidden_kstrdup(s, flags)
304#else 306#else
305#define snd_memory_init() /*NOP*/ 307#define snd_memory_init() /*NOP*/
306#define snd_memory_done() /*NOP*/ 308#define snd_memory_done() /*NOP*/
@@ -311,7 +313,6 @@ void snd_hidden_vfree(void *obj);
311#define kfree_nocheck(obj) kfree(obj) 313#define kfree_nocheck(obj) kfree(obj)
312#define vfree_nocheck(obj) vfree(obj) 314#define vfree_nocheck(obj) vfree(obj)
313#endif 315#endif
314char *snd_kmalloc_strdup(const char *string, int flags);
315int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count); 316int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
316int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count); 317int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
317 318