lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E4974451-025B-4694-89FE-20B310D6DFBF@coraid.com>
Date:	Thu, 1 Aug 2013 21:04:36 -0400
From:	Ed Cashin <ecashin@...aid.com>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:	<linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] aoe: remove custom implementation of kbasename()

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@...ux.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@...aid.com


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ