lkml.org 
[lkml]   [2023]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] mtd: rawnand: fix -Wvoid-pointer-to-enum-cast warning
Date
On Thu, 2023-08-17 at 17:52:21 UTC, Justin Stitt wrote:
> When building with clang 18 I see the following warning:
> | drivers/mtd/nand/raw/vf610_nfc.c:853:17: warning: cast to smaller integer
> | type 'enum vf610_nfc_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> | 853 | nfc->variant = (enum vf610_nfc_variant)of_id->data;
>
> This is due to the fact that `of_id->data` is a void* while `enum vf610_nfc_variant`
> has the size of an int.
>
> Cast `of_id->data` to a uintptr_t to silence the above warning for clang
> builds using W=1.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1910
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Justin Stitt <justinstitt@google.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

\
 
 \ /
  Last update: 2023-08-18 16:42    [W:0.043 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site