[PATCH 1/2] lsm: constify function parameters

Paul Moore paul at paul-moore.com
Sun Jan 5 03:04:37 UTC 2025


On Nov 25, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche at seltendoof.de> wrote:
> 
> The functions print_ipv4_addr() and print_ipv6_addr() are called with
> string literals and do not modify these parameters internally.
> 
> Reported by clang:
> 
>     security/lsm_audit.c:324:7: warning: passing 'const char[6]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
>       324 |                                                 "laddr", "lport");
>           |                                                 ^~~~~~~
>     security/lsm_audit.c:183:27: note: passing argument to parameter 'name1' here
>       183 |                                    __be16 port, char *name1, char *name2)
>           |                                                       ^
> 
> Signed-off-by: Christian Göttsche <cgzones at googlemail.com>
> ---
>  security/lsm_audit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Merged into lsm/dev, thanks.

--
paul-moore.com



More information about the Linux-security-module-archive mailing list