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>
This commit is contained in:
committed by
Linus Torvalds
parent
896dcd9a64
commit
a88c1f0cac
@@ -12,6 +12,7 @@
|
|||||||
#include <linux/bitmap.h>
|
#include <linux/bitmap.h>
|
||||||
#include <linux/kdev_t.h>
|
#include <linux/kdev_t.h>
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
|
#include <linux/string.h>
|
||||||
#include "aoe.h"
|
#include "aoe.h"
|
||||||
|
|
||||||
static void dummy_timer(ulong);
|
static void dummy_timer(ulong);
|
||||||
@@ -241,16 +242,12 @@ aoedev_downdev(struct aoedev *d)
|
|||||||
static int
|
static int
|
||||||
user_req(char *s, size_t slen, struct aoedev *d)
|
user_req(char *s, size_t slen, struct aoedev *d)
|
||||||
{
|
{
|
||||||
char *p;
|
const char *p;
|
||||||
size_t lim;
|
size_t lim;
|
||||||
|
|
||||||
if (!d->gd)
|
if (!d->gd)
|
||||||
return 0;
|
return 0;
|
||||||
p = strrchr(d->gd->disk_name, '/');
|
p = kbasename(d->gd->disk_name);
|
||||||
if (!p)
|
|
||||||
p = d->gd->disk_name;
|
|
||||||
else
|
|
||||||
p += 1;
|
|
||||||
lim = sizeof(d->gd->disk_name);
|
lim = sizeof(d->gd->disk_name);
|
||||||
lim -= p - d->gd->disk_name;
|
lim -= p - d->gd->disk_name;
|
||||||
if (slen < lim)
|
if (slen < lim)
|
||||||
|
Reference in New Issue
Block a user