genetlink: make genl_info->nlhdr const
authorJakub Kicinski <kuba@kernel.org>
Mon, 14 Aug 2023 21:47:15 +0000 (14:47 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Aug 2023 21:54:44 +0000 (14:54 -0700)
struct netlink_callback has a const nlh pointer, make the
pointer in struct genl_info const as well, to make copying
between the two easier.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230814214723.2924989-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/genetlink.h
net/ncsi/ncsi-netlink.c
net/ncsi/ncsi-netlink.h

index ed4622d..0366d09 100644 (file)
@@ -104,7 +104,7 @@ struct genl_family {
 struct genl_info {
        u32                     snd_seq;
        u32                     snd_portid;
-       struct nlmsghdr *       nlhdr;
+       const struct nlmsghdr * nlhdr;
        struct genlmsghdr *     genlhdr;
        void *                  userhdr;
        struct nlattr **        attrs;
index d27f4ec..a3a6753 100644 (file)
@@ -563,7 +563,7 @@ int ncsi_send_netlink_timeout(struct ncsi_request *nr,
 int ncsi_send_netlink_err(struct net_device *dev,
                          u32 snd_seq,
                          u32 snd_portid,
-                         struct nlmsghdr *nlhdr,
+                         const struct nlmsghdr *nlhdr,
                          int err)
 {
        struct nlmsghdr *nlh;
index 39a1a9d..747767e 100644 (file)
@@ -19,7 +19,7 @@ int ncsi_send_netlink_timeout(struct ncsi_request *nr,
 int ncsi_send_netlink_err(struct net_device *dev,
                          u32 snd_seq,
                          u32 snd_portid,
-                         struct nlmsghdr *nlhdr,
+                         const struct nlmsghdr *nlhdr,
                          int err);
 
 #endif /* __NCSI_NETLINK_H__ */