diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-09-11 17:25:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:59:26 -0400 |
commit | a88c1f0caccaa335690d53ea03b12de31c357263 (patch) | |
tree | 324d4a39649ad3d36e6325aed2b71216f8df9413 /drivers/block/aoe/aoedev.c | |
parent | 896dcd9a64a86d8792302615ee8ab118dc8afd9c (diff) |
aoe: remove custom implementation of kbasename()
In the kernel we have a nice helper that may be used here. This patch
substitutes the custom implementation by the native function call.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r-- | drivers/block/aoe/aoedev.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index c9047675dfc9..e774c50b6842 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/bitmap.h> | 12 | #include <linux/bitmap.h> |
13 | #include <linux/kdev_t.h> | 13 | #include <linux/kdev_t.h> |
14 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
15 | #include <linux/string.h> | ||
15 | #include "aoe.h" | 16 | #include "aoe.h" |
16 | 17 | ||
17 | static void dummy_timer(ulong); | 18 | static void dummy_timer(ulong); |
@@ -241,16 +242,12 @@ aoedev_downdev(struct aoedev *d) | |||
241 | static int | 242 | static int |
242 | user_req(char *s, size_t slen, struct aoedev *d) | 243 | user_req(char *s, size_t slen, struct aoedev *d) |
243 | { | 244 | { |
244 | char *p; | 245 | const char *p; |
245 | size_t lim; | 246 | size_t lim; |
246 | 247 | ||
247 | if (!d->gd) | 248 | if (!d->gd) |
248 | return 0; | 249 | return 0; |
249 | p = strrchr(d->gd->disk_name, '/'); | 250 | p = kbasename(d->gd->disk_name); |
250 | if (!p) | ||
251 | p = d->gd->disk_name; | ||
252 | else | ||
253 | p += 1; | ||
254 | lim = sizeof(d->gd->disk_name); | 251 | lim = sizeof(d->gd->disk_name); |
255 | lim -= p - d->gd->disk_name; | 252 | lim -= p - d->gd->disk_name; |
256 | if (slen < lim) | 253 | if (slen < lim) |