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>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Feb 2012 17:36:07 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Greg KH <greg@...ah.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] sysfs: Remove CPP abuse

There's absolutely no reason to abuse CPP to shorten a common sub
expression, C has variables for this.


Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
---
 fs/sysfs/dir.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 7fdf6a7..80fb6e6 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -576,8 +576,11 @@ struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent *parent_sd,
 	}
 
 	while (p) {
+		struct sysfs_dirent *node;
 		int c;
-#define node	rb_entry(p, struct sysfs_dirent, name_node)
+	       
+		node = rb_entry(p, struct sysfs_dirent, name_node);
+
 		c = strcmp(name, node->s_name);
 		if (c < 0) {
 			p = node->name_node.rb_left;
@@ -587,7 +590,6 @@ struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent *parent_sd,
 			found = node;
 			p = node->name_node.rb_left;
 		}
-#undef node
 	}
 
 	if (found) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ