Skip to content

Commit 1c2197c

Browse files
Jiri Pirkodavem330
authored andcommitted
devlink: extend devlink_nl_put_nested_handle() with attrtype arg
As the next patch is going to call this helper with need to fill another type of nested attribute, pass it over function arg. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent af1f140 commit 1c2197c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

net/devlink/devl_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink)
146146
}
147147

148148
int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
149-
struct devlink *devlink);
149+
struct devlink *devlink, int attrtype);
150150
int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info);
151151

152152
/* Notify */

net/devlink/linecard.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg,
114114

115115
if (linecard->nested_devlink &&
116116
devlink_nl_put_nested_handle(msg, devlink_net(devlink),
117-
linecard->nested_devlink))
117+
linecard->nested_devlink,
118+
DEVLINK_ATTR_NESTED_DEVLINK))
118119
goto nla_put_failure;
119120

120121
genlmsg_end(msg, hdr);

net/devlink/netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = {
8383
};
8484

8585
int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
86-
struct devlink *devlink)
86+
struct devlink *devlink, int attrtype)
8787
{
8888
struct nlattr *nested_attr;
8989

90-
nested_attr = nla_nest_start(msg, DEVLINK_ATTR_NESTED_DEVLINK);
90+
nested_attr = nla_nest_start(msg, attrtype);
9191
if (!nested_attr)
9292
return -EMSGSIZE;
9393
if (devlink_nl_put_handle(msg, devlink))

0 commit comments

Comments
 (0)