Re: [patch 1/4] add kstrndup

From: Randy Dunlap
Date: Tue May 08 2007 - 17:55:42 EST


On Tue, 08 May 2007 13:51:30 -0700 Jeremy Fitzhardinge wrote:

> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -18,7 +18,7 @@ void *__kzalloc(size_t size, gfp_t flags
> }
> EXPORT_SYMBOL(__kzalloc);
>
> -/*
> +/**
> * kstrdup - allocate space for and copy an existing string

No blank ("*") line between function name and its parameters.
(occurs in multiple places in multiple patches in this series;
I'm not going to point out each one of them separately)

> *
> * @s: the string to duplicate
> @@ -39,6 +39,33 @@ char *kstrdup(const char *s, gfp_t gfp)
> return buf;
> }
> EXPORT_SYMBOL(kstrdup);
> +
> +/**
> + * kstrndup - allocate space for and copy an existing string
> + *
> + * @s: the string to duplicate
> + * @max: read at most @max chars from @s
> + * @gfp: the GFP mask used in the kmalloc() call when allocating memory
> + */
> +char *kstrndup(const char *s, size_t max, gfp_t gfp)
> +{
> +}
> +EXPORT_SYMBOL(kstrndup);
>
> /**
> * kmemdup - duplicate region of memory
> ===================================================================

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/