mkfs.f2fs: do not need strdup for parse_feature
authorYunlong Song <yunlong.song@huawei.com>
Wed, 21 Sep 2016 10:09:18 +0000 (18:09 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 22 Sep 2016 18:39:19 +0000 (11:39 -0700)
strdup is useless here, with no free op with its return value.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
mkfs/f2fs_format_main.c

index 8a7b604..40ccdc7 100644 (file)
@@ -60,7 +60,7 @@ static void f2fs_show_info()
        MSG(0, "Info: Trim is %s\n", config.trim ? "enabled": "disabled");
 }
 
-static void parse_feature(char *features)
+static void parse_feature(const char *features)
 {
        if (!strcmp(features, "encrypt")) {
                config.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT);
@@ -104,7 +104,7 @@ static void f2fs_parse_options(int argc, char *argv[])
                        config.overprovision = atof(optarg);
                        break;
                case 'O':
-                       parse_feature(strdup(optarg));
+                       parse_feature(optarg);
                        break;
                case 's':
                        config.segs_per_sec = atoi(optarg);