[PATCH] power: vexpress: fix -Wvoid-pointer-to-enum-cast warning

Sudeep Holla sudeep.holla at arm.com
Fri Aug 18 02:44:53 PDT 2023


On Mon, Aug 14, 2023 at 10:21:51PM +0000, Justin Stitt wrote:
> 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: Nathan Chancellor <nathan at kernel.org>

Hi Sebastian,

I am assuming you will pick this up.

Acked-by: Sudeep Holla <sudeep.holla at arm.com>

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list