netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] connector: Fix invalid conversion in cn_proc.h
@ 2024-05-10 15:49 Matt Jan
  2024-05-14  0:53 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Jan @ 2024-05-10 15:49 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, netdev; +Cc: linux-kernel, Matt Jan, Matt Jan

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>
---
 include/uapi/linux/cn_proc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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);
 }
 
 /*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-24  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 15:49 [PATCH] connector: Fix invalid conversion in cn_proc.h Matt Jan
2024-05-14  0:53 ` Jakub Kicinski
2024-05-14  4:10   ` [PATCH v2] " Matt Jan
2024-05-24  9:40     ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).