summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-07-28 04:21:54 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 22:05:24 +0200
commitf03a5729287a8bc1eb061a2f849b5a33ed9cd3ab (patch)
tree866280fd0824feb2642169fd064f702310c17e39 /drivers/mtd/nand/nandsim.c
parentmtd: nandsim: convert pages_written[] to bitmap (diff)
downloadlinux-f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab.tar.xz
linux-f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab.zip
mtd: nandsim: use kasprintf()
Use kasprintf() which combines kmalloc and sprintf. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index a73dce020816..ac1b46cbd33e 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -654,9 +654,7 @@ static void free_device(struct nandsim *ns)
static char *get_partition_name(int i)
{
- char buf[64];
- sprintf(buf, "NAND simulator partition %d", i);
- return kstrdup(buf, GFP_KERNEL);
+ return kasprintf(GFP_KERNEL, "NAND simulator partition %d", i);
}
/*