Subject: Re: [PATCH] connector: Fix invalid conversion in cn_proc.h

From: Jakub Kicinski <[email-masked]>
Date: Mon, 13 May 2024 17:53:55 -0700

On Fri, 10 May 2024 23:49:19 +0800 Matt Jan wrote:
> From: Matt Jan <[email-masked]>
> 
> 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 <[email-masked]>

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