lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 11 Nov 2021 19:02:47 -0800
From:   Yihao Han <hanyihao@...o.com>
To:     Yihao Han <hanyihao@...o.com>, linux-kernel@...r.kernel.org
Cc:     kernel@...o.com
Subject: [PATCH] libtraceevent: use swap() to make code cleaner

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Signed-off-by: Yihao Han <hanyihao@...o.com>
---
 tools/lib/traceevent/event-parse.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index fe58843d047c..71bddcc9ff3b 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2081,14 +2081,10 @@ process_op(struct tep_event *event, struct tep_print_arg *arg, char **tok)
 
 		if (right->type == TEP_PRINT_OP &&
 		    get_op_prio(arg->op.op) < get_op_prio(right->op.op)) {
-			struct tep_print_arg tmp;
-
 			/* rotate ops according to the priority */
 			arg->op.right = right->op.left;
 
-			tmp = *arg;
-			*arg = *right;
-			*right = tmp;
+			swap(*arg, *right);
 
 			arg->op.left = right;
 		} else {
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ