From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC 1/2] kmemdup: introduce
Date: Wed, 13 Sep 2006 09:17:11 -0700 [thread overview]
Message-ID: <20060913091711.aa4021f0.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060909013555.GC5192@martell.zuzino.mipt.ru>
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
prev parent reply other threads:[~2006-09-13 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-09 1:35 Alexey Dobriyan
2006-09-09 1:50 ` Andrew Morton
2006-09-09 22:55 ` Pekka Enberg
2006-09-13 16:17 ` Randy.Dunlap [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060913091711.aa4021f0.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®