[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140131103232.GB1534@amd.pavel.ucw.cz>
Date: Fri, 31 Jan 2014 11:32:32 +0100
From: Pavel Machek <pavel@....cz>
To: Sebastian Capella <sebastian.capella@...aro.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-pm@...r.kernel.org, linaro-kernel@...ts.linaro.org,
patches@...aro.org, Andrew Morton <akpm@...ux-foundation.org>,
Michel Lespinasse <walken@...gle.com>,
Shaohua Li <shli@...nel.org>,
Jerome Marchand <jmarchan@...hat.com>,
Mikulas Patocka <mpatocka@...hat.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH v4 1/2] mm: add kstrimdup function
On Wed 2014-01-29 15:48:23, Sebastian Capella wrote:
> kstrimdup will duplicate and trim spaces from the passed in
> null terminated string. This is useful for strings coming from
> sysfs that often include trailing whitespace due to user input.
Is it good idea? I mean "\n\n/foo bar baz" is valid filename in
unix. This is kernel interface, it is not meant to be too user
friendly...
Pavel
> +char *kstrimdup(const char *s, gfp_t gfp)
> +{
> + char *ret = kstrdup(skip_spaces(s), gfp);
> +
> + if (ret)
> + strim(ret);
> + return ret;
> +}
> +EXPORT_SYMBOL(kstrimdup);
> +
> +/**
> * kmemdup - duplicate region of memory
> *
> * @src: memory region to duplicate
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists