Commit ce4cfa23 authored by Jakub Kicinski's avatar Jakub Kicinski

net: remove else after return in dev_prep_valid_name()

Remove unnecessary else clauses after return.
I copied this if / else construct from somewhere,
it makes the code harder to read.
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231023152346.3639749-7-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 70e1b14c
......@@ -1131,14 +1131,13 @@ static int dev_prep_valid_name(struct net *net, struct net_device *dev,
if (!dev_valid_name(want_name))
return -EINVAL;
if (strchr(want_name, '%')) {
if (strchr(want_name, '%'))
return __dev_alloc_name(net, want_name, out_name);
} else if (netdev_name_in_use(net, want_name)) {
if (netdev_name_in_use(net, want_name))
return -dup_errno;
} else if (out_name != want_name) {
if (out_name != want_name)
strscpy(out_name, want_name, IFNAMSIZ);
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment