diff mbox series

[v1,1/2] SUNRPC: Clean up the svc_xprt_flags() macro

Message ID 167459281558.15600.1555010122091924488.stgit@manet.1015granger.net (mailing list archive)
State New, archived
Headers show
Series [v1,1/2] SUNRPC: Clean up the svc_xprt_flags() macro | expand

Commit Message

Chuck Lever Jan. 24, 2023, 8:40 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

Make this macro more conventional:
 - Use BIT() instead of open-coding " 1UL << "
 - Don't display the "XPT_" in every flag name

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 include/trace/events/sunrpc.h |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

Comments

Jeff Layton Jan. 25, 2023, 1:44 p.m. UTC | #1
On Tue, 2023-01-24 at 15:40 -0500, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> Make this macro more conventional:
>  - Use BIT() instead of open-coding " 1UL << "
>  - Don't display the "XPT_" in every flag name
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>  include/trace/events/sunrpc.h |   28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
> index 37604e0e5963..3ca54536f8f7 100644
> --- a/include/trace/events/sunrpc.h
> +++ b/include/trace/events/sunrpc.h
> @@ -1819,20 +1819,20 @@ TRACE_EVENT(svc_stats_latency,
>  
>  #define show_svc_xprt_flags(flags)					\
>  	__print_flags(flags, "|",					\
> -		{ (1UL << XPT_BUSY),		"XPT_BUSY"},		\
> -		{ (1UL << XPT_CONN),		"XPT_CONN"},		\
> -		{ (1UL << XPT_CLOSE),		"XPT_CLOSE"},		\
> -		{ (1UL << XPT_DATA),		"XPT_DATA"},		\
> -		{ (1UL << XPT_TEMP),		"XPT_TEMP"},		\
> -		{ (1UL << XPT_DEAD),		"XPT_DEAD"},		\
> -		{ (1UL << XPT_CHNGBUF),		"XPT_CHNGBUF"},		\
> -		{ (1UL << XPT_DEFERRED),	"XPT_DEFERRED"},	\
> -		{ (1UL << XPT_OLD),		"XPT_OLD"},		\
> -		{ (1UL << XPT_LISTENER),	"XPT_LISTENER"},	\
> -		{ (1UL << XPT_CACHE_AUTH),	"XPT_CACHE_AUTH"},	\
> -		{ (1UL << XPT_LOCAL),		"XPT_LOCAL"},		\
> -		{ (1UL << XPT_KILL_TEMP),	"XPT_KILL_TEMP"},	\
> -		{ (1UL << XPT_CONG_CTRL),	"XPT_CONG_CTRL"})
> +		{ BIT(XPT_BUSY),		"BUSY" },		\
> +		{ BIT(XPT_CONN),		"CONN" },		\
> +		{ BIT(XPT_CLOSE),		"CLOSE" },		\
> +		{ BIT(XPT_DATA),		"DATA" },		\
> +		{ BIT(XPT_TEMP),		"TEMP" },		\
> +		{ BIT(XPT_DEAD),		"DEAD" },		\
> +		{ BIT(XPT_CHNGBUF),		"CHNGBUF" },		\
> +		{ BIT(XPT_DEFERRED),		"DEFERRED" },		\
> +		{ BIT(XPT_OLD),			"OLD" },		\
> +		{ BIT(XPT_LISTENER),		"LISTENER" },		\
> +		{ BIT(XPT_CACHE_AUTH),		"CACHE_AUTH" },		\
> +		{ BIT(XPT_LOCAL),		"LOCAL" },		\
> +		{ BIT(XPT_KILL_TEMP),		"KILL_TEMP" },		\
> +		{ BIT(XPT_CONG_CTRL),		"CONG_CTRL" })
>  
>  TRACE_EVENT(svc_xprt_create_err,
>  	TP_PROTO(
> 
> 

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 37604e0e5963..3ca54536f8f7 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -1819,20 +1819,20 @@  TRACE_EVENT(svc_stats_latency,
 
 #define show_svc_xprt_flags(flags)					\
 	__print_flags(flags, "|",					\
-		{ (1UL << XPT_BUSY),		"XPT_BUSY"},		\
-		{ (1UL << XPT_CONN),		"XPT_CONN"},		\
-		{ (1UL << XPT_CLOSE),		"XPT_CLOSE"},		\
-		{ (1UL << XPT_DATA),		"XPT_DATA"},		\
-		{ (1UL << XPT_TEMP),		"XPT_TEMP"},		\
-		{ (1UL << XPT_DEAD),		"XPT_DEAD"},		\
-		{ (1UL << XPT_CHNGBUF),		"XPT_CHNGBUF"},		\
-		{ (1UL << XPT_DEFERRED),	"XPT_DEFERRED"},	\
-		{ (1UL << XPT_OLD),		"XPT_OLD"},		\
-		{ (1UL << XPT_LISTENER),	"XPT_LISTENER"},	\
-		{ (1UL << XPT_CACHE_AUTH),	"XPT_CACHE_AUTH"},	\
-		{ (1UL << XPT_LOCAL),		"XPT_LOCAL"},		\
-		{ (1UL << XPT_KILL_TEMP),	"XPT_KILL_TEMP"},	\
-		{ (1UL << XPT_CONG_CTRL),	"XPT_CONG_CTRL"})
+		{ BIT(XPT_BUSY),		"BUSY" },		\
+		{ BIT(XPT_CONN),		"CONN" },		\
+		{ BIT(XPT_CLOSE),		"CLOSE" },		\
+		{ BIT(XPT_DATA),		"DATA" },		\
+		{ BIT(XPT_TEMP),		"TEMP" },		\
+		{ BIT(XPT_DEAD),		"DEAD" },		\
+		{ BIT(XPT_CHNGBUF),		"CHNGBUF" },		\
+		{ BIT(XPT_DEFERRED),		"DEFERRED" },		\
+		{ BIT(XPT_OLD),			"OLD" },		\
+		{ BIT(XPT_LISTENER),		"LISTENER" },		\
+		{ BIT(XPT_CACHE_AUTH),		"CACHE_AUTH" },		\
+		{ BIT(XPT_LOCAL),		"LOCAL" },		\
+		{ BIT(XPT_KILL_TEMP),		"KILL_TEMP" },		\
+		{ BIT(XPT_CONG_CTRL),		"CONG_CTRL" })
 
 TRACE_EVENT(svc_xprt_create_err,
 	TP_PROTO(