All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: qrtr: correct types of trace event parameters
@ 2023-04-03 15:43 Simon Horman
  2023-04-05  2:10 ` patchwork-bot+netdevbpf
  2023-04-06  8:07 ` Mukesh Ojha
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Horman @ 2023-04-03 15:43 UTC (permalink / raw)
  To: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni
  Cc: Manivannan Sadhasivam, Steven Rostedt, Masami Hiramatsu,
	linux-arm-msm, linux-kernel, linux-trace-kernel, netdev

The arguments passed to the trace events are of type unsigned int,
however the signature of the events used __le32 parameters.

I may be missing the point here, but sparse flagged this and it
does seem incorrect to me.

  net/qrtr/ns.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/qrtr.h):
  ./include/trace/events/qrtr.h:11:1: warning: cast to restricted __le32
  ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
  ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
  ... (a lot more similar warnings)
  net/qrtr/ns.c:115:47:    expected restricted __le32 [usertype] service
  net/qrtr/ns.c:115:47:    got unsigned int service
  net/qrtr/ns.c:115:61: warning: incorrect type in argument 2 (different base types)
  ... (a lot more similar warnings)

Fixes: dfddb54043f0 ("net: qrtr: Add tracepoint support")
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Simon Horman <horms@kernel.org>
---
v1
* Drop RFC designation
* Add Fixes and Reviewed-by tags
* Target at 'net-next' (not sure if that is correct)

RFC
* Link: https://lore.kernel.org/r/20230402-qrtr-trace-types-v1-1-da062d368e74@kernel.org
---
 include/trace/events/qrtr.h | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/include/trace/events/qrtr.h b/include/trace/events/qrtr.h
index b1de14c3bb93..441132c67133 100644
--- a/include/trace/events/qrtr.h
+++ b/include/trace/events/qrtr.h
@@ -10,15 +10,16 @@
 
 TRACE_EVENT(qrtr_ns_service_announce_new,
 
-	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
+	TP_PROTO(unsigned int service, unsigned int instance,
+		 unsigned int node, unsigned int port),
 
 	TP_ARGS(service, instance, node, port),
 
 	TP_STRUCT__entry(
-		__field(__le32, service)
-		__field(__le32, instance)
-		__field(__le32, node)
-		__field(__le32, port)
+		__field(unsigned int, service)
+		__field(unsigned int, instance)
+		__field(unsigned int, node)
+		__field(unsigned int, port)
 	),
 
 	TP_fast_assign(
@@ -36,15 +37,16 @@ TRACE_EVENT(qrtr_ns_service_announce_new,
 
 TRACE_EVENT(qrtr_ns_service_announce_del,
 
-	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
+	TP_PROTO(unsigned int service, unsigned int instance,
+		 unsigned int node, unsigned int port),
 
 	TP_ARGS(service, instance, node, port),
 
 	TP_STRUCT__entry(
-		__field(__le32, service)
-		__field(__le32, instance)
-		__field(__le32, node)
-		__field(__le32, port)
+		__field(unsigned int, service)
+		__field(unsigned int, instance)
+		__field(unsigned int, node)
+		__field(unsigned int, port)
 	),
 
 	TP_fast_assign(
@@ -62,15 +64,16 @@ TRACE_EVENT(qrtr_ns_service_announce_del,
 
 TRACE_EVENT(qrtr_ns_server_add,
 
-	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
+	TP_PROTO(unsigned int service, unsigned int instance,
+		 unsigned int node, unsigned int port),
 
 	TP_ARGS(service, instance, node, port),
 
 	TP_STRUCT__entry(
-		__field(__le32, service)
-		__field(__le32, instance)
-		__field(__le32, node)
-		__field(__le32, port)
+		__field(unsigned int, service)
+		__field(unsigned int, instance)
+		__field(unsigned int, node)
+		__field(unsigned int, port)
 	),
 
 	TP_fast_assign(


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

* Re: [PATCH net-next] net: qrtr: correct types of trace event parameters
  2023-04-03 15:43 [PATCH net-next] net: qrtr: correct types of trace event parameters Simon Horman
@ 2023-04-05  2:10 ` patchwork-bot+netdevbpf
  2023-04-06  8:07 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-05  2:10 UTC (permalink / raw)
  To: Simon Horman
  Cc: kuba, davem, edumazet, pabeni, mani, rostedt, mhiramat,
	linux-arm-msm, linux-kernel, linux-trace-kernel, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 03 Apr 2023 17:43:16 +0200 you wrote:
> The arguments passed to the trace events are of type unsigned int,
> however the signature of the events used __le32 parameters.
> 
> I may be missing the point here, but sparse flagged this and it
> does seem incorrect to me.
> 
>   net/qrtr/ns.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/qrtr.h):
>   ./include/trace/events/qrtr.h:11:1: warning: cast to restricted __le32
>   ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
>   ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
>   ... (a lot more similar warnings)
>   net/qrtr/ns.c:115:47:    expected restricted __le32 [usertype] service
>   net/qrtr/ns.c:115:47:    got unsigned int service
>   net/qrtr/ns.c:115:61: warning: incorrect type in argument 2 (different base types)
>   ... (a lot more similar warnings)
> 
> [...]

Here is the summary with links:
  - [net-next] net: qrtr: correct types of trace event parameters
    https://git.kernel.org/netdev/net-next/c/054fbf7ff814

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net-next] net: qrtr: correct types of trace event parameters
  2023-04-03 15:43 [PATCH net-next] net: qrtr: correct types of trace event parameters Simon Horman
  2023-04-05  2:10 ` patchwork-bot+netdevbpf
@ 2023-04-06  8:07 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2023-04-06  8:07 UTC (permalink / raw)
  To: Simon Horman, Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni
  Cc: Manivannan Sadhasivam, Steven Rostedt, Masami Hiramatsu,
	linux-arm-msm, linux-kernel, linux-trace-kernel, netdev



On 4/3/2023 9:13 PM, Simon Horman wrote:
> The arguments passed to the trace events are of type unsigned int,
> however the signature of the events used __le32 parameters.
> 
> I may be missing the point here, but sparse flagged this and it
> does seem incorrect to me.
> 
>    net/qrtr/ns.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/qrtr.h):
>    ./include/trace/events/qrtr.h:11:1: warning: cast to restricted __le32
>    ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
>    ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer
>    ... (a lot more similar warnings)
>    net/qrtr/ns.c:115:47:    expected restricted __le32 [usertype] service
>    net/qrtr/ns.c:115:47:    got unsigned int service
>    net/qrtr/ns.c:115:61: warning: incorrect type in argument 2 (different base types)
>    ... (a lot more similar warnings)
> 
> Fixes: dfddb54043f0 ("net: qrtr: Add tracepoint support")
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
> v1
> * Drop RFC designation
> * Add Fixes and Reviewed-by tags
> * Target at 'net-next' (not sure if that is correct)
> 
> RFC
> * Link: https://lore.kernel.org/r/20230402-qrtr-trace-types-v1-1-da062d368e74@kernel.org
> ---
>   include/trace/events/qrtr.h | 33 ++++++++++++++++++---------------
>   1 file changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/include/trace/events/qrtr.h b/include/trace/events/qrtr.h
> index b1de14c3bb93..441132c67133 100644
> --- a/include/trace/events/qrtr.h
> +++ b/include/trace/events/qrtr.h
> @@ -10,15 +10,16 @@
>   
>   TRACE_EVENT(qrtr_ns_service_announce_new,
>   
> -	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
> +	TP_PROTO(unsigned int service, unsigned int instance,
> +		 unsigned int node, unsigned int port),
>   
>   	TP_ARGS(service, instance, node, port),
>   
>   	TP_STRUCT__entry(
> -		__field(__le32, service)
> -		__field(__le32, instance)
> -		__field(__le32, node)
> -		__field(__le32, port)
> +		__field(unsigned int, service)
> +		__field(unsigned int, instance)
> +		__field(unsigned int, node)
> +		__field(unsigned int, port)
>   	),
>   
>   	TP_fast_assign(
> @@ -36,15 +37,16 @@ TRACE_EVENT(qrtr_ns_service_announce_new,
>   
>   TRACE_EVENT(qrtr_ns_service_announce_del,
>   
> -	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
> +	TP_PROTO(unsigned int service, unsigned int instance,
> +		 unsigned int node, unsigned int port),
>   
>   	TP_ARGS(service, instance, node, port),
>   
>   	TP_STRUCT__entry(
> -		__field(__le32, service)
> -		__field(__le32, instance)
> -		__field(__le32, node)
> -		__field(__le32, port)
> +		__field(unsigned int, service)
> +		__field(unsigned int, instance)
> +		__field(unsigned int, node)
> +		__field(unsigned int, port)
>   	),
>   
>   	TP_fast_assign(
> @@ -62,15 +64,16 @@ TRACE_EVENT(qrtr_ns_service_announce_del,
>   
>   TRACE_EVENT(qrtr_ns_server_add,
>   
> -	TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port),
> +	TP_PROTO(unsigned int service, unsigned int instance,
> +		 unsigned int node, unsigned int port),
>   
>   	TP_ARGS(service, instance, node, port),
>   
>   	TP_STRUCT__entry(
> -		__field(__le32, service)
> -		__field(__le32, instance)
> -		__field(__le32, node)
> -		__field(__le32, port)
> +		__field(unsigned int, service)
> +		__field(unsigned int, instance)
> +		__field(unsigned int, node)
> +		__field(unsigned int, port)

Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>

-- Mukesh

>   	),
>   
>   	TP_fast_assign(
> 

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

end of thread, other threads:[~2023-04-06  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 15:43 [PATCH net-next] net: qrtr: correct types of trace event parameters Simon Horman
2023-04-05  2:10 ` patchwork-bot+netdevbpf
2023-04-06  8:07 ` Mukesh Ojha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.