Re: [PATCH] connector: Fix invalid conversion in cn_proc.h
From: Jakub Kicinski
Date: Mon May 13 2024 - 20:54:04 EST
On Fri, 10 May 2024 23:49:19 +0800 Matt Jan wrote:
> From: Matt Jan <matt_jan@xxxxxxxxxxxxxx>
>
> The implicit conversion from unsigned int to enum
> proc_cn_event is invalid, so explicitly cast it
> for compilation in a C++ compiler.
> /usr/include/linux/cn_proc.h: In function 'proc_cn_event valid_event(proc_cn_event)':
> /usr/include/linux/cn_proc.h:72:17: error: invalid conversion from 'unsigned int' to 'proc_cn_event' [-fpermissive]
> 72 | ev_type &= PROC_EVENT_ALL;
> | ^
> | |
> | unsigned int
>
> Signed-off-by: Matt Jan <zoo868e@xxxxxxxxx>
Why not. But please fix the checkpatch warning:
CHECK: No space is necessary after a cast
#36: FILE: include/uapi/linux/cn_proc.h:72:
+ return (enum proc_cn_event) (ev_type & PROC_EVENT_ALL);
--
pw-bot: cr