Re: [RFC 1/2] kmemdup: introduce

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux