From: Przemek Kitszel Date: Wed, 23 Oct 2024 13:09:01 +0000 (+0200) Subject: devlink: introduce devlink_nl_put_u64() X-Git-Tag: v6.13-rc1~135^2~196^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da3ee3cd79ca900ae435777bd3193080197c2aca;p=thirdparty%2Fkernel%2Flinux.git devlink: introduce devlink_nl_put_u64() Add devlink_nl_put_u64() that abstracts padding for u64 values. All u64 values are passed with the very same padding option. Reviewed-by: Wojciech Drewek Reviewed-by: Jiri Pirko Reviewed-by: Joe Damato Signed-off-by: Przemek Kitszel Link: https://patch.msgid.link/20241023131248.27192-2-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski --- diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h index a9f064ab9ed9b..14eaad9cfe357 100644 --- a/net/devlink/devl_internal.h +++ b/net/devlink/devl_internal.h @@ -181,6 +181,11 @@ devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink) return 0; } +static inline int devlink_nl_put_u64(struct sk_buff *msg, int attrtype, u64 val) +{ + return nla_put_u64_64bit(msg, attrtype, val, DEVLINK_ATTR_PAD); +} + int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net, struct devlink *devlink, int attrtype); int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info);