connector: Fix invalid conversion in cn_proc.h

[ Upstream commit 06e785aeb9 ]

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@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Matt Jan 2024-05-14 12:10:46 +08:00 committed by Greg Kroah-Hartman
parent 39d31edcf9
commit 9258d79597

View File

@ -69,8 +69,7 @@ struct proc_input {
static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type) static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type)
{ {
ev_type &= PROC_EVENT_ALL; return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL);
return ev_type;
} }
/* /*