On Fri, 14 Mar 2008 16:40:36 -0400 Masami Hiramatsu <mhiramat@redhat.com> wrote:This hurts my brain. If your usage pattern is: struct foo { ... struct list_head bar_list; /* A list of `struct bar's */ }; struct bar { struct list_head list; /* Attached to foo.bar_list */ ... }; then yes, list_singleton() makes sense. But in other usage patterns it does not: struct foo { struct bar *bar_list; ... }; struct bar { struct list_head list; /* All the other bars go here */ ... }; In the second case, emptiness is signified by foo.bar_list==NULL. And in this case, code which does if (foo->bar_list && list_singleton(&foo->bar_list->list)) will fail if there is a single item on the list! The second usage pattern is uncommon and list_empty() also returns misleading answers when list_heads are used this way. So I guess we can proceed with your list_singleton(), but I'd just like to flag this possible confusion, see what people think.. --
| Ryan Hope | reiser4 for 2.6.27-rc1 |
| Michael Kerrisk | Re: Slow DOWN, please!!! |
| Greg KH | [ANNOUNCE] linux-staging tree created |
| Ingo Molnar | Re: Rescheduling interrupts |
git: | |
| Sverre Rabbelier | Git vs Monotone |
| Kyle Moffett | Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Steffen Prohaska | Re: [msysGit] Re: safecrlf not in 1.5.4 |
| Shawn O. Pearce | [PATCH] Correct dir.c to compile on Solaris 9 |
| Richard Stallman | Real men don't attack straw men |
| Jerome Santos | sshd.config and AllowUsers |
| Calomel | Re: Remove escape characters from file |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Sunando Sen | Re: [Q] "Cannot execute /bin/*sh: Permission denied" prevents login |
| C Wayne Huling | Re: Can males come from... |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Craig I. Hagan | Re: Segate ST02 problems |
