From: Masami Hiramatsu <mhiramat@redhat.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
ananth@in.ibm.com, jkenisto@us.ibm.com,
linux-kernel@vger.kernel.org, systemtap@sources.redhat.com,
prasanna@in.ibm.com, shaohua.li@intel.com, davem@davemloft.net,
fche@redhat.com
Subject: [PATCH -mm] list.h: rename list_singleton to list_is_singular
Date: Mon, 17 Mar 2008 16:52:48 -0400 [thread overview]
Message-ID: <47DEDA20.30006@redhat.com> (raw)
In-Reply-To: <1205766798.8514.318.camel@twins>
Rename list_singleton to list_is_singular.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.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@redhat.com
prev parent reply other threads:[~2008-03-17 20:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 20:40 [PATCH -mm 1/5] list.h: add list_singleton Masami Hiramatsu
2008-03-14 21:00 ` Andrew Morton
2008-03-14 22:22 ` Masami Hiramatsu
2008-03-15 22:36 ` Peter Zijlstra
2008-03-17 15:04 ` Masami Hiramatsu
2008-03-17 15:13 ` Peter Zijlstra
2008-03-17 20:52 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47DEDA20.30006@redhat.com \
--to=mhiramat@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=davem@davemloft.net \
--cc=fche@redhat.com \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prasanna@in.ibm.com \
--cc=shaohua.li@intel.com \
--cc=systemtap@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.