Browse Source

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>
Akinobu Mita 12 years ago
parent
commit
f03a572928
1 changed files with 1 additions and 3 deletions
  1. 1 3
      drivers/mtd/nand/nandsim.c

+ 1 - 3
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);
 }
 
 /*