lkml.org 
[lkml]   [2006]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 1/2] kmemdup: introduce
On Sat, 9 Sep 2006 05:35:55 +0400 Alexey Dobriyan wrote:

> Not tested yet, this is for semantics commentary.
>
> include/linux/string.h | 1 +
> mm/util.c | 18 ++++++++++++++++++
> 2 files changed, 19 insertions(+)
>
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -40,6 +40,24 @@ char *kstrdup(const char *s, gfp_t gfp)
> }
> EXPORT_SYMBOL(kstrdup);
>
> +/**
> + * kmemdup - duplicate region of memory
> + *

No blank line here, please. kernel-doc "language" doesn't allow
that. Hopefully that will be fixed someday.

> + * @src: memory region to duplicate
> + * @len: memory region length
> + * @gfp: GFP mask to use
> + */
> +void *kmemdup(const void *src, size_t len, gfp_t gfp)
> +{
> + void *p;
> +
> + p = ____kmalloc(len, gfp);
> + if (p)
> + memcpy(p, src, len);
> + return p;
> +}
> +EXPORT_SYMBOL(kmemdup);

---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-13 18:19    [W:0.069 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site