LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ken Helias <kenhelias@web.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ken Helias <kenhelias@firemail.de>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 05/13] powerpc: Use list_add_(before|after) macros
Date: Fri,  6 Jun 2014 19:34:24 +0200	[thread overview]
Message-ID: <1402076072-4044-5-git-send-email-kenhelias@web.de> (raw)
In-Reply-To: <1402076072-4044-1-git-send-email-kenhelias@web.de>

From: Ken Helias <kenhelias@firemail.de>

Many places in the code uses list_add_tail/list_add to insert an entry
before/after another entry. This confuses the reader because these are usually
used to add an item to a list_head and not an entry. Better use the self
explaining function name.

Signed-off-by: Ken Helias <kenhelias@firemail.de>
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/lib/rheap.c          | 2 +-
 arch/powerpc/mm/dma-noncoherent.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index a1060a8..d8c5f16 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -486,7 +486,7 @@ unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const ch
 			spblk->start = blk->start;
 			spblk->size = sp_size;
 			/* add before the blk */
-			list_add(&spblk->list, blk->list.prev);
+			list_add_before(&spblk->list, &blk->list);
 		}
 		newblk = get_slot(info);
 		newblk->start = start;
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
index d85e86a..222ae97 100644
--- a/arch/powerpc/mm/dma-noncoherent.c
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -120,7 +120,7 @@ ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
 	/*
 	 * Insert this entry _before_ the one we found.
 	 */
-	list_add_tail(&new->vm_list, &c->vm_list);
+	list_add_before(&new->vm_list, &c->vm_list);
 	new->vm_start = addr;
 	new->vm_end = addr + size;
 
-- 
2.0.0

           reply	other threads:[~2014-06-06 17:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1402076072-4044-1-git-send-email-kenhelias@web.de>]

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=1402076072-4044-5-git-send-email-kenhelias@web.de \
    --to=kenhelias@web.de \
    --cc=akpm@linux-foundation.org \
    --cc=kenhelias@firemail.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox