From: Ed Cashin <ecashin@coraid.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] aoe: remove custom implementation of kbasename()
Date: Thu, 1 Aug 2013 21:04:36 -0400 [thread overview]
Message-ID: <E4974451-025B-4694-89FE-20B310D6DFBF@coraid.com> (raw)
In-Reply-To: <1375360134-20860-1-git-send-email-andriy.shevchenko@linux.intel.com>
Looks OK. Thanks.
On Aug 1, 2013, at 8:28 AM, Andy Shevchenko wrote:
> 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>
> ---
> drivers/block/aoe/aoedev.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
> index 784c92e..db35ef6 100644
> --- a/drivers/block/aoe/aoedev.c
> +++ b/drivers/block/aoe/aoedev.c
> @@ -12,6 +12,7 @@
> #include <linux/bitmap.h>
> #include <linux/kdev_t.h>
> #include <linux/moduleparam.h>
> +#include <linux/string.h>
> #include "aoe.h"
>
> static void dummy_timer(ulong);
> @@ -241,16 +242,12 @@ aoedev_downdev(struct aoedev *d)
> static int
> user_req(char *s, size_t slen, struct aoedev *d)
> {
> - char *p;
> + const char *p;
> size_t lim;
>
> if (!d->gd)
> return 0;
> - p = strrchr(d->gd->disk_name, '/');
> - if (!p)
> - p = d->gd->disk_name;
> - else
> - p += 1;
> + p = kbasename(d->gd->disk_name);
> lim = sizeof(d->gd->disk_name);
> lim -= p - d->gd->disk_name;
> if (slen < lim)
> --
> 1.8.3.2
>
--
Ed Cashin
ecashin@coraid.com
prev parent reply other threads:[~2013-08-02 1:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 12:28 Andy Shevchenko
2013-08-01 12:28 ` [PATCH 2/2] aoe: use min() to simplify the code Andy Shevchenko
2013-08-02 1:13 ` Ed Cashin
2013-08-02 9:15 ` Andy Shevchenko
2013-08-02 1:04 ` Ed Cashin [this message]
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=E4974451-025B-4694-89FE-20B310D6DFBF@coraid.com \
--to=ecashin@coraid.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®