Message ID | 20240510154919.874-1-zoo868e@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | connector: Fix invalid conversion in cn_proc.h | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
On Fri, 10 May 2024 23:49:19 +0800 Matt Jan wrote: > From: Matt Jan <matt_jan@trendmicro.com> > > 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> 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);
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h index f2afb7cc4926..22f9419498ca 100644 --- a/include/uapi/linux/cn_proc.h +++ b/include/uapi/linux/cn_proc.h @@ -69,8 +69,7 @@ struct proc_input { static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type) { - ev_type &= PROC_EVENT_ALL; - return ev_type; + return (enum proc_cn_event) (ev_type & PROC_EVENT_ALL); } /*