From f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 28 Jul 2013 11:21:54 +0900 Subject: mtd: nandsim: use kasprintf() Use kasprintf() which combines kmalloc and sprintf. Signed-off-by: Akinobu Mita Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/nand/nandsim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/mtd/nand/nandsim.c') 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); } /* -- cgit v1.2.3