mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-16 00:34:32 +08:00
btrfs-progs: prop: remove conditions which never be satisfied
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>
This commit is contained in:
parent
ad474ff50c
commit
640391b299
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user