Skip to content

Commit 6d86bb0

Browse files
jacob-kellerdavem330
authored andcommitted
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 f4b6bcc ("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 <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6876214 commit 6d86bb0

File tree

2 files changed

+65
-70
lines changed

2 files changed

+65
-70
lines changed

net/devlink/dev.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static struct net *devlink_netns_get(struct sk_buff *skb,
305305
struct net *net;
306306

307307
if (!!netns_pid_attr + !!netns_fd_attr + !!netns_id_attr > 1) {
308-
NL_SET_ERR_MSG_MOD(info->extack, "multiple netns identifying attributes specified");
308+
NL_SET_ERR_MSG(info->extack, "multiple netns identifying attributes specified");
309309
return ERR_PTR(-EINVAL);
310310
}
311311

@@ -323,7 +323,7 @@ static struct net *devlink_netns_get(struct sk_buff *skb,
323323
net = ERR_PTR(-EINVAL);
324324
}
325325
if (IS_ERR(net)) {
326-
NL_SET_ERR_MSG_MOD(info->extack, "Unknown network namespace");
326+
NL_SET_ERR_MSG(info->extack, "Unknown network namespace");
327327
return ERR_PTR(-EINVAL);
328328
}
329329
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)
425425

426426
err = devlink_resources_validate(devlink, NULL, info);
427427
if (err) {
428-
NL_SET_ERR_MSG_MOD(info->extack, "resources size validation failed");
428+
NL_SET_ERR_MSG(info->extack, "resources size validation failed");
429429
return err;
430430
}
431431

@@ -435,8 +435,7 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
435435
action = DEVLINK_RELOAD_ACTION_DRIVER_REINIT;
436436

437437
if (!devlink_reload_action_is_supported(devlink, action)) {
438-
NL_SET_ERR_MSG_MOD(info->extack,
439-
"Requested reload action is not supported by the driver");
438+
NL_SET_ERR_MSG(info->extack, "Requested reload action is not supported by the driver");
440439
return -EOPNOTSUPP;
441440
}
442441

@@ -448,26 +447,23 @@ int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
448447
limits = nla_get_bitfield32(info->attrs[DEVLINK_ATTR_RELOAD_LIMITS]);
449448
limits_selected = limits.value & limits.selector;
450449
if (!limits_selected) {
451-
NL_SET_ERR_MSG_MOD(info->extack, "Invalid limit selected");
450+
NL_SET_ERR_MSG(info->extack, "Invalid limit selected");
452451
return -EINVAL;
453452
}
454453
for (limit = 0 ; limit <= DEVLINK_RELOAD_LIMIT_MAX ; limit++)
455454
if (limits_selected & BIT(limit))
456455
break;
457456
/* UAPI enables multiselection, but currently it is not used */
458457
if (limits_selected != BIT(limit)) {
459-
NL_SET_ERR_MSG_MOD(info->extack,
460-
"Multiselection of limit is not supported");
458+
NL_SET_ERR_MSG(info->extack, "Multiselection of limit is not supported");
461459
return -EOPNOTSUPP;
462460
}
463461
if (!devlink_reload_limit_is_supported(devlink, limit)) {
464-
NL_SET_ERR_MSG_MOD(info->extack,
465-
"Requested limit is not supported by the driver");
462+
NL_SET_ERR_MSG(info->extack, "Requested limit is not supported by the driver");
466463
return -EOPNOTSUPP;
467464
}
468465
if (devlink_reload_combination_is_invalid(action, limit)) {
469-
NL_SET_ERR_MSG_MOD(info->extack,
470-
"Requested limit is invalid for this action");
466+
NL_SET_ERR_MSG(info->extack, "Requested limit is invalid for this action");
471467
return -EINVAL;
472468
}
473469
}

0 commit comments

Comments
 (0)