lkml.org 
[lkml]   [2012]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/4] block: replace rssd_disk_name_format() to disk_name_format()
  Currently, block core has been supplied "disk_name_format()", so
we should remove duplicate function "rssd_disk_name_format()"
and use the new function to format rssd disk names.

Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
---
mtip32xx.c | 33 +--------------------------------
1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c
b/drivers/block/mtip32xx/mtip32xx.c
index 8eb81c9..8950bb5 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -2836,37 +2836,6 @@ static int mtip_hw_resume(struct driver_data *dd)
}

/*
- * Helper function for reusing disk name
- * upon hot insertion.
- */
-static int rssd_disk_name_format(char *prefix,
- int index,
- char *buf,
- int buflen)
-{
- const int base = 'z' - 'a' + 1;
- char *begin = buf + strlen(prefix);
- char *end = buf + buflen;
- char *p;
- int unit;
-
- p = end - 1;
- *p = '\0';
- unit = base;
- do {
- if (p == begin)
- return -EINVAL;
- *--p = 'a' + (index % unit);
- index = (index / unit) - 1;
- } while (index >= 0);
-
- memmove(begin, p, end - p);
- memcpy(buf, prefix, strlen(prefix));
-
- return 0;
-}
-
-/*
* Block layer IOCTL handler.
*
* @dev Pointer to the block_device structure.
@@ -3140,7 +3109,7 @@ static int mtip_block_initialize(struct
driver_data *dd)
if (rv)
goto ida_get_error;

- rv = rssd_disk_name_format("rssd",
+ rv = disk_name_format("rssd",
index,
dd->disk->disk_name,
DISK_NAME_LEN);


\
 
 \ /
  Last update: 2012-03-30 11:55    [W:0.143 / U:15.552 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site