Skip to content
Commit 4ec7b666 authored by Justin Stitt's avatar Justin Stitt Committed by Sebastian Reichel
Browse files

power: vexpress: fix -Wvoid-pointer-to-enum-cast warning



When building with clang 18 I see the following warning:
|       drivers/power/reset/vexpress-poweroff.c:124:10: warning: cast to smaller integer type 'enum vexpress_reset_func' from 'const void *' [-Wvoid-pointer-to-enum-cast]
|         124 |         switch ((enum vexpress_reset_func)match->data) {

This is due to the fact that `match->data` is a void* while `enum vexpress_reset_func`
has the size of an int. This leads to truncation and possible data loss.

Link: https://github.com/ClangBuiltLinux/linux/issues/1910
Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 926ce6ba
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment