]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lsm: constify function parameters
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 25 Nov 2024 10:59:24 +0000 (11:59 +0100)
committerPaul Moore <paul@paul-moore.com>
Sun, 5 Jan 2025 03:04:39 +0000 (22:04 -0500)
The functions print_ipv4_addr() and print_ipv6_addr() are called with
string literals and do not modify these parameters internally.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: cleaned up the description to remove long lines]
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/lsm_audit.c

index 9a8352972086cf6cc7492c7717b1f9ab6ec0b20e..8df6f77a7526b68966d8457a3d3ed8224f85f057 100644 (file)
@@ -171,7 +171,7 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb,
 
 static inline void print_ipv6_addr(struct audit_buffer *ab,
                                   const struct in6_addr *addr, __be16 port,
-                                  char *name1, char *name2)
+                                  const char *name1, const char *name2)
 {
        if (!ipv6_addr_any(addr))
                audit_log_format(ab, " %s=%pI6c", name1, addr);
@@ -180,7 +180,7 @@ static inline void print_ipv6_addr(struct audit_buffer *ab,
 }
 
 static inline void print_ipv4_addr(struct audit_buffer *ab, __be32 addr,
-                                  __be16 port, char *name1, char *name2)
+                                  __be16 port, const char *name1, const char *name2)
 {
        if (addr)
                audit_log_format(ab, " %s=%pI4", name1, &addr);