diff mbox series

[v2] connector: Fix invalid conversion in cn_proc.h

Message ID 20240514041046.98784-1-zoo868e@gmail.com (mailing list archive)
State Accepted
Commit 06e785aeb9ea8a43d0a3967c1ba6e69d758e82d4
Headers show
Series [v2] connector: Fix invalid conversion in cn_proc.h | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Matt Jan May 14, 2024, 4:10 a.m. UTC
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>
---
change in v2:
	fix: remove space after cast

 include/uapi/linux/cn_proc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 24, 2024, 9:40 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 14 May 2024 12:10:46 +0800 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [v2] connector: Fix invalid conversion in cn_proc.h
    https://git.kernel.org/netdev/net/c/06e785aeb9ea

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
index f2afb7cc4926..18e3745b86cd 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);
 }
 
 /*