diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-07-28 11:21:54 +0900 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 21:05:24 +0100 |
commit | f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab (patch) | |
tree | 866280fd0824feb2642169fd064f702310c17e39 /drivers | |
parent | 08efe91a1befa67bcc3799e0d29b7194803e1538 (diff) |
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')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 4 |
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); } /* |