All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: linux-mm@kvack.org
Cc: sjenning@linux.vnet.ibm.com
Subject: [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly
Date: Wed, 15 Jan 2014 12:22:17 +0800	[thread overview]
Message-ID: <52D60CF9.3010609@oracle.com> (raw)

From: Jie Liu <jeff.liu@oracle.com>

Get rid of the self defined list_tail_entry() helper and
use list_last_entry() in zbud_reclaim_page() directly.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 mm/zbud.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/zbud.c b/mm/zbud.c
index 9451361..8ac1e97 100644
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -360,9 +360,6 @@ void zbud_free(struct zbud_pool *pool, unsigned long handle)
 	spin_unlock(&pool->lock);
 }
 
-#define list_tail_entry(ptr, type, member) \
-	list_entry((ptr)->prev, type, member)
-
 /**
  * zbud_reclaim_page() - evicts allocations from a pool page and frees it
  * @pool:	pool from which a page will attempt to be evicted
@@ -411,7 +408,7 @@ int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)
 		return -EINVAL;
 	}
 	for (i = 0; i < retries; i++) {
-		zhdr = list_tail_entry(&pool->lru, struct zbud_header, lru);
+		zhdr = list_last_entry(&pool->lru, struct zbud_header, lru);
 		list_del(&zhdr->lru);
 		list_del(&zhdr->buddy);
 		/* Protect zbud page against free */
-- 
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2014-01-15  4:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  4:22 Jeff Liu [this message]
2014-01-15 19:48 ` [PATCH] mm/zbud: use list_last_entry in zbud_reclaim_page() directly Seth Jennings

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=52D60CF9.3010609@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@linux.vnet.ibm.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.