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>
This commit is contained in:
Akinobu Mita 2013-07-28 11:21:54 +09:00 committed by David Woodhouse
parent 08efe91a1b
commit f03a572928
1 changed files with 1 additions and 3 deletions

View File

@ -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);
}
/*