mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + fs-proc-use-rb_entry_safe-instead-of-rb_entry.patch added to -mm tree
@ 2014-10-28 21:45 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2014-10-28 21:45 UTC (permalink / raw)
  To: nicolas.dichtel, mm-commits


The patch titled
     Subject: fs/proc.c: use rb_entry_safe() instead of rb_entry()
has been added to the -mm tree.  Its filename is
     fs-proc-use-rb_entry_safe-instead-of-rb_entry.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-proc-use-rb_entry_safe-instead-of-rb_entry.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-proc-use-rb_entry_safe-instead-of-rb_entry.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: fs/proc.c: use rb_entry_safe() instead of rb_entry()

Better to use existing macro that rewriting them.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/proc/generic.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff -puN fs/proc/generic.c~fs-proc-use-rb_entry_safe-instead-of-rb_entry fs/proc/generic.c
--- a/fs/proc/generic.c~fs-proc-use-rb_entry_safe-instead-of-rb_entry
+++ a/fs/proc/generic.c
@@ -41,22 +41,14 @@ static int proc_match(unsigned int len,
 
 static struct proc_dir_entry *pde_subdir_first(struct proc_dir_entry *dir)
 {
-	struct rb_node *node = rb_first(&dir->subdir);
-
-	if (node == NULL)
-		return NULL;
-
-	return rb_entry(node, struct proc_dir_entry, subdir_node);
+	return rb_entry_safe(rb_first(&dir->subdir), struct proc_dir_entry,
+			     subdir_node);
 }
 
 static struct proc_dir_entry *pde_subdir_next(struct proc_dir_entry *dir)
 {
-	struct rb_node *node = rb_next(&dir->subdir_node);
-
-	if (node == NULL)
-		return NULL;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-28 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-28 21:45 + fs-proc-use-rb_entry_safe-instead-of-rb_entry.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).