mirror of https://gitee.com/openkylin/linux.git
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:
parent
08efe91a1b
commit
f03a572928
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue