mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
[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>
This commit is contained in:
parent
991114c6fa
commit
543537bd92
21 changed files with 75 additions and 94 deletions
|
|
@ -925,10 +925,6 @@ extern int skb_checksum_help(struct sk_buff *skb, int inward);
|
|||
extern void net_enable_timestamp(void);
|
||||
extern void net_disable_timestamp(void);
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
extern char *net_sysctl_strdup(const char *s);
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_DEV_H */
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
|
|||
extern void * memchr(const void *,int,__kernel_size_t);
|
||||
#endif
|
||||
|
||||
extern char *kstrdup(const char *s, int gfp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -292,6 +292,7 @@ void *snd_hidden_kcalloc(size_t n, size_t size, int flags);
|
|||
void snd_hidden_kfree(const void *obj);
|
||||
void *snd_hidden_vmalloc(unsigned long size);
|
||||
void snd_hidden_vfree(void *obj);
|
||||
char *snd_hidden_kstrdup(const char *s, int flags);
|
||||
#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
|
||||
#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
|
||||
#define kfree(obj) snd_hidden_kfree(obj)
|
||||
|
|
@ -301,6 +302,7 @@ void snd_hidden_vfree(void *obj);
|
|||
#define vmalloc_nocheck(size) snd_wrapper_vmalloc(size)
|
||||
#define kfree_nocheck(obj) snd_wrapper_kfree(obj)
|
||||
#define vfree_nocheck(obj) snd_wrapper_vfree(obj)
|
||||
#define kstrdup(s, flags) snd_hidden_kstrdup(s, flags)
|
||||
#else
|
||||
#define snd_memory_init() /*NOP*/
|
||||
#define snd_memory_done() /*NOP*/
|
||||
|
|
@ -311,7 +313,6 @@ void snd_hidden_vfree(void *obj);
|
|||
#define kfree_nocheck(obj) kfree(obj)
|
||||
#define vfree_nocheck(obj) vfree(obj)
|
||||
#endif
|
||||
char *snd_kmalloc_strdup(const char *string, int flags);
|
||||
int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
|
||||
int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue