strdup is useless here, with no free op with its return value.

Signed-off-by: Yunlong Song <yunlong.s...@huawei.com>
---
 mkfs/f2fs_format_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index 8a7b604..40ccdc7 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -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);
-- 
1.8.5.2


------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to