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@xxxxxxxxxxxxxx>
---
cmds-property.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/cmds-property.c b/cmds-property.c
index 46be8f3..e59882b 100644
--- a/cmds-property.c
+++ b/cmds-property.c
@@ -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);
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html