netdevsim: Update dummy reporter's devlink binary interface

Update dummy reporter's output to use updated devlink interface of
binary fmsg pair.

Signed-off-by: Aya Levin <ayal@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Aya Levin 2019-11-12 14:07:51 +02:00 committed by David S. Miller
parent d4e82cf4df
commit 8fdcd8fb21

View File

@ -82,18 +82,12 @@ static int nsim_dev_dummy_fmsg_put(struct devlink_fmsg *fmsg, u32 binary_len)
if (err)
return err;
err = devlink_fmsg_arr_pair_nest_start(fmsg, "test_binary");
if (err)
return err;
binary = kmalloc(binary_len, GFP_KERNEL);
if (!binary)
return -ENOMEM;
get_random_bytes(binary, binary_len);
err = devlink_fmsg_binary_put(fmsg, binary, binary_len);
err = devlink_fmsg_binary_pair_put(fmsg, "test_binary", binary, binary_len);
kfree(binary);
if (err)
return err;
err = devlink_fmsg_arr_pair_nest_end(fmsg);
if (err)
return err;