diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-10-12 20:46:22 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2022-10-17 01:58:54 +0300 |
commit | 91924d9bb1df2a234a0e055c550abdbd49412071 (patch) | |
tree | 325928145615e03a4e02040be95800aa4fa43dac /Documentation/crypto/index.rst | |
parent | 32e8f9b3144496c76ad659c255246ecee7b47669 (diff) | |
download | linux-91924d9bb1df2a234a0e055c550abdbd49412071.tar.xz |
of: declare string literals const
of_overlay_action_name() returns a string literal from a function local
array. Modifying string literals is undefined behavior which usage of
const pointer can avoid. of_overlay_action_name() is currently only
used once in overlay_notify() to print the returned value.
While on it declare the data array const as well.
Reported by Clang:
In file included from arch/x86/kernel/asm-offsets.c:22:
In file included from arch/x86/kernel/../kvm/vmx/vmx.h:5:
In file included from ./include/linux/kvm_host.h:19:
In file included from ./include/linux/msi.h:23:
In file included from ./arch/x86/include/asm/msi.h:5:
In file included from ./arch/x86/include/asm/irqdomain.h:5:
In file included from ./include/linux/irqdomain.h:35:
./include/linux/of.h:1555:3: error: initializing 'char *' with an expression of type 'const char[5]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
"init",
^~~~~~
./include/linux/of.h:1556:3: error: initializing 'char *' with an expression of type 'const char[10]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
"pre-apply",
^~~~~~~~~~~
./include/linux/of.h:1557:3: error: initializing 'char *' with an expression of type 'const char[11]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
"post-apply",
^~~~~~~~~~~~
./include/linux/of.h:1558:3: error: initializing 'char *' with an expression of type 'const char[11]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
"pre-remove",
^~~~~~~~~~~~
./include/linux/of.h:1559:3: error: initializing 'char *' with an expression of type 'const char[12]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
"post-remove",
^~~~~~~~~~~~~
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20221012174622.45006-1-cgzones@googlemail.com
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'Documentation/crypto/index.rst')
0 files changed, 0 insertions, 0 deletions