summaryrefslogtreecommitdiff
path: root/net/devlink/dev.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2023-02-09 14:20:45 -0800
committerDavid S. Miller <davem@davemloft.net>2023-02-13 09:37:29 +0000
commit6d86bb0a5cb82bd459b017f180bdc47bec561b2d (patch)
treecf9b661fda04e864e927705db4611d4dda305298 /net/devlink/dev.c
parent68762148d1b011d47bc2ceed7321739b5aea1e63 (diff)
devlink: stop using NL_SET_ERR_MSG_MOD
NL_SET_ERR_MSG_MOD inserts the KBUILD_MODNAME and a ':' before the actual extended error message. The devlink feature hasn't been able to be compiled as a module since commit f4b6bcc7002f ("net: devlink: turn devlink into a built-in"). Stop using NL_SET_ERR_MSG_MOD, and just use the base NL_SET_ERR_MSG. This aligns the extended error messages better with the NL_SET_ERR_MSG_ATTR messages as well. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/devlink/dev.c')
-rw-r--r--net/devlink/dev.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/devlink/dev.c b/net/devlink/dev.c
index 78d824eda5ec..7cf2de44e02f 100644
--- a/net/devlink/dev.c
+++ b/net/devlink/dev.c
@@ -305,7 +305,7 @@ static struct net *devlink_netns_get(struct sk_buff *skb,
struct net *net;
if (!!netns_pid_attr + !!netns_fd_attr + !!netns_id_attr > 1) {
- NL_SET_ERR_MSG_MOD(info->extack, "multiple netns identifying attributes specified");
+ NL_SET_ERR_MSG(info->extack, "multiple netns identifying attributes specified");
return ERR_PTR(-EINVAL);
}
@@ -323,7 +323,7 @@ static struct net *devlink_netns_get(struct sk_buff *skb,
net = ERR_PTR(-EINVAL);
}
if (IS_ERR(net)) {
- NL_SET_ERR_MSG_MOD(info->extack, "Unknown network namespace");
+ NL_SET_ERR_MSG(info->extack, "Unknown network namespace");
return ERR_PTR(-EINVAL);
}
if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) {
@@ -425,7 +425,7 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
err = devlink_resources_validate(devlink, NULL, info);
if (err) {
- NL_SET_ERR_MSG_MOD(info->extack, "resources size validation failed");
+ NL_SET_ERR_MSG(info->extack, "resources size validation failed");
return err;
}
@@ -435,8 +435,7 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
action = DEVLINK_RELOAD_ACTION_DRIVER_REINIT;
if (!devlink_reload_action_is_supported(devlink, action)) {
- NL_SET_ERR_MSG_MOD(info->extack,
- "Requested reload action is not supported by the driver");
+ NL_SET_ERR_MSG(info->extack, "Requested reload action is not supported by the driver");
return -EOPNOTSUPP;
}
@@ -448,7 +447,7 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
limits = nla_get_bitfield32(info->attrs[DEVLINK_ATTR_RELOAD_LIMITS]);
limits_selected = limits.value & limits.selector;
if (!limits_selected) {
- NL_SET_ERR_MSG_MOD(info->extack, "Invalid limit selected");
+ NL_SET_ERR_MSG(info->extack, "Invalid limit selected");
return -EINVAL;
}
for (limit = 0 ; limit <= DEVLINK_RELOAD_LIMIT_MAX ; limit++)
@@ -456,18 +455,15 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
break;
/* UAPI enables multiselection, but currently it is not used */
if (limits_selected != BIT(limit)) {
- NL_SET_ERR_MSG_MOD(info->extack,
- "Multiselection of limit is not supported");
+ NL_SET_ERR_MSG(info->extack, "Multiselection of limit is not supported");
return -EOPNOTSUPP;
}
if (!devlink_reload_limit_is_supported(devlink, limit)) {
- NL_SET_ERR_MSG_MOD(info->extack,
- "Requested limit is not supported by the driver");
+ NL_SET_ERR_MSG(info->extack, "Requested limit is not supported by the driver");
return -EOPNOTSUPP;
}
if (devlink_reload_combination_is_invalid(action, limit)) {
- NL_SET_ERR_MSG_MOD(info->extack,
- "Requested limit is invalid for this action");
+ NL_SET_ERR_MSG(info->extack, "Requested limit is invalid for this action");
return -EINVAL;
}
}