From: Adrian Bunk <bunk@stusta.de>
To: Robert Love <rml@novell.com>
Cc: linux-kernel@vger.kernel.org
Subject: [-mm patch] inotify: fsnotify.h: use kstrdup
Date: Sat, 2 Jul 2005 00:55:59 +0200 [thread overview]
Message-ID: <20050701225559.GC3592@stusta.de> (raw)
kstrdup was added in 2.6.13-rc1.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.12-mm2-full/include/linux/fsnotify.h.old 2005-06-30 22:26:07.000000000 +0200
+++ linux-2.6.12-mm2-full/include/linux/fsnotify.h 2005-06-30 22:27:26.000000000 +0200
@@ -216,19 +216,10 @@
/*
* fsnotify_oldname_init - save off the old filename before we change it
- *
- * XXX: This could be kstrdup if only we could add that to lib/string.c
*/
static inline const char *fsnotify_oldname_init(const char *name)
{
- size_t len;
- char *buf;
-
- len = strlen(name) + 1;
- buf = kmalloc(len, GFP_KERNEL);
- if (likely(buf))
- memcpy(buf, name, len);
- return buf;
+ return kstrdup(name, GFP_KERNEL);
}
/*
next reply other threads:[~2005-07-01 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-01 22:55 Adrian Bunk [this message]
2005-07-01 23:20 ` [-mm patch] inotify: fsnotify.h: use kstrdup Roland Dreier
2005-07-01 23:28 ` Adrian Bunk
2005-07-01 23:36 ` Robert Love
2005-07-01 23:36 ` Robert Love
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=20050701225559.GC3592@stusta.de \
--to=bunk@stusta.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.