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-prev] [day] [month] [year] [list]
Date:	Mon, 17 Mar 2008 16:52:48 -0400
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC:	Andrew Morton <akpm@...ux-foundation.org>, ananth@...ibm.com,
	jkenisto@...ibm.com, linux-kernel@...r.kernel.org,
	systemtap@...rces.redhat.com, prasanna@...ibm.com,
	shaohua.li@...el.com, davem@...emloft.net, fche@...hat.com
Subject: [PATCH -mm] list.h: rename list_singleton to list_is_singular

Rename list_singleton to list_is_singular.

Signed-off-by: Masami Hiramatsu <mhiramat@...hat.com>
---
Peter Zijlstra wrote:
> I think list_has_one() or list_is_singular() are good names, they convey
> they are a test for a condition by using a form of be.

OK, I picked up list_is_singular().

Thanks,

 include/linux/list.h |    4 ++--
 kernel/kprobes.c     |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: 2.6.25-rc5-mm1/include/linux/list.h
===================================================================
--- 2.6.25-rc5-mm1.orig/include/linux/list.h
+++ 2.6.25-rc5-mm1/include/linux/list.h
@@ -212,10 +212,10 @@ static inline int list_empty_careful(con
 }

 /**
- * list_singleton - tests whether a list has just one entry.
+ * list_is_singular - tests whether a list has just one entry.
  * @head: the list to test.
  */
-static inline int list_singleton(const struct list_head *head)
+static inline int list_is_singular(const struct list_head *head)
 {
 	return !list_empty(head) && (head->next == head->prev);
 }
Index: 2.6.25-rc5-mm1/kernel/kprobes.c
===================================================================
--- 2.6.25-rc5-mm1.orig/kernel/kprobes.c
+++ 2.6.25-rc5-mm1/kernel/kprobes.c
@@ -643,7 +643,7 @@ static int __kprobes __unregister_kprobe
 valid_p:
 	if (old_p == p ||
 	    (old_p->pre_handler == aggr_pre_handler &&
-	     list_singleton(&old_p->list))) {
+	     list_is_singular(&old_p->list))) {
 		/*
 		 * Only probe on the hash list. Disarm only if kprobes are
 		 * enabled - otherwise, the breakpoint would already have
@@ -679,7 +679,7 @@ static void __kprobes __unregister_kprob
 			module_put(mod);
 	}

-	if (list_empty(&p->list) || list_singleton(&p->list)) {
+	if (list_empty(&p->list) || list_is_singular(&p->list)) {
 		if (!list_empty(&p->list)) {
 			/* "p" is the last child of an aggr_kprobe */
 			old_p = list_entry(p->list.next, struct kprobe, list);


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com

--
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