btrfs-progs: prop: remove conditions which never be satisfied
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Mon, 9 May 2016 07:52:11 +0000 (16:52 +0900)
committerDavid Sterba <dsterba@suse.com>
Wed, 11 May 2016 14:43:42 +0000 (16:43 +0200)
parse_args() always set at least one parameter, 'object', for
{get,list} subcommands. In addition, it always set all three
parameters, 'object', 'name', and 'value' for set subcommand.
So the following conditions can be removed.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-property.c

index 46be8f3b94d6eb8517300527a0ded748bf240ff5..e59882b43ac946d7cb72105cc9d0d15acaff39bc 100644 (file)
@@ -385,10 +385,6 @@ static int cmd_property_get(int argc, char **argv)
 
        parse_args(argc, argv, cmd_property_get_usage, &types, &object, &name,
                   NULL, 1);
-       if (!object) {
-               error("invalid arguments");
-               usage(cmd_property_get_usage);
-       }
 
        if (name)
                ret = setget_prop(types, object, name, NULL);
@@ -416,10 +412,6 @@ static int cmd_property_set(int argc, char **argv)
 
        parse_args(argc, argv, cmd_property_set_usage, &types,
                   &object, &name, &value, 3);
-       if (!object || !name || !value) {
-               error("invalid arguments");
-               usage(cmd_property_set_usage);
-       }
 
        ret = setget_prop(types, object, name, value);
 
@@ -442,10 +434,6 @@ static int cmd_property_list(int argc, char **argv)
 
        parse_args(argc, argv, cmd_property_list_usage,
                   &types, &object, NULL, NULL, 1);
-       if (!object) {
-               error("invalid arguments");
-               usage(cmd_property_list_usage);
-       }
 
        ret = dump_props(types, object, 1);