diff options
author | Justin Stitt <justinstitt@google.com> | 2023-08-15 01:11:28 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2023-10-05 00:41:57 +0300 |
commit | 38c2efa260e6d0eab861c21c6ad1e4d79e1377ac (patch) | |
tree | c696068c6a471453fa265e283647ae7bd6e2272d /drivers/dio | |
parent | d8237f8733efeb2f687907e73c658e4662dbfa00 (diff) | |
download | linux-38c2efa260e6d0eab861c21c6ad1e4d79e1377ac.tar.xz |
pmdomain: renesas: rmobile-sysc: fix -Wvoid-pointer-to-enum-cast warning
When building with clang 18 I see the following warning:
| drivers/soc/renesas/rmobile-sysc.c:193:22: warning: cast to smaller integer
| type 'enum pd_types' from 'const void *' [-Wvoid-pointer-to-enum-cast]
| 193 | add_special_pd(np, (enum pd_types)id->data);
This is due to the fact that `id->data` is a void* and `enum pd_types`
has the size of an integer. This cast from pointer-width to int-width
causes truncation and possible data loss. Instead, cast to `uintptr_t`
which has the same width as void*.
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://github.com/ClangBuiltLinux/linux/issues/1910
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230814-void-drivers-soc-renesas-rmobile-sysc-v1-1-6648dfd854de@google.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/dio')
0 files changed, 0 insertions, 0 deletions