public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <mita@miraclelinux.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, Karsten Keil <kkeil@suse.de>,
	Jan Harkes <jaharkes@cs.cmu.edu>, Jan Kara <jack@suse.cz>,
	David Woodhouse <dwmw2@infradead.org>,
	Sridhar Samudrala <sri@us.ibm.com>
Subject: Re: [patch 3/8] use list_add_tail() instead of list_add()
Date: Fri, 31 Mar 2006 11:54:29 +0800	[thread overview]
Message-ID: <20060331035429.GA8767@miraclelinux.com> (raw)
In-Reply-To: <20060330081730.068972000@localhost.localdomain>

On Thu, Mar 30, 2006 at 04:16:08PM +0800, Akinobu Mita wrote:
> This patch converts list_add(A, B.prev) to list_add_tail(A, &B)
> for readability.

>  drivers/isdn/capi/capi.c |    2 +-
>  fs/coda/psdev.c          |    2 +-
>  fs/coda/upcall.c         |    2 +-
>  fs/dcache.c              |    2 +-
>  fs/dquot.c               |    4 ++--
>  fs/jffs2/compr.c         |    4 ++--
>  net/sctp/outqueue.c      |    2 +-
>  7 files changed, 9 insertions(+), 9 deletions(-)

I realized that the replacements in isdn, jffs2, and sctp made them less
readable. Because these are trying to insert the list node into right
place, not trying to insert the tail of the list head.

This patch reverts them.

Index: 2.6-git/net/sctp/outqueue.c
===================================================================
--- 2.6-git.orig/net/sctp/outqueue.c
+++ 2.6-git/net/sctp/outqueue.c
@@ -370,7 +370,7 @@ static void sctp_insert_list(struct list
 		lchunk = list_entry(pos, struct sctp_chunk, transmitted_list);
 		ltsn = ntohl(lchunk->subh.data_hdr->tsn);
 		if (TSN_lt(ntsn, ltsn)) {
-			list_add_tail(new, pos);
+			list_add(new, pos->prev);
 			done = 1;
 			break;
 		}
Index: 2.6-git/drivers/isdn/capi/capi.c
===================================================================
--- 2.6-git.orig/drivers/isdn/capi/capi.c
+++ 2.6-git/drivers/isdn/capi/capi.c
@@ -238,7 +238,7 @@ static struct capiminor *capiminor_alloc
 		
 		if (minor < capi_ttyminors) {
 			mp->minor = minor;
-			list_add_tail(&mp->list, &p->list);
+			list_add(&mp->list, p->list.prev);
 		}
 	}
 		write_unlock_irqrestore(&capiminor_list_lock, flags);
Index: 2.6-git/fs/jffs2/compr.c
===================================================================
--- 2.6-git.orig/fs/jffs2/compr.c
+++ 2.6-git/fs/jffs2/compr.c
@@ -231,7 +231,7 @@ int jffs2_register_compressor(struct jff
 
         list_for_each_entry(this, &jffs2_compressor_list, list) {
                 if (this->priority < comp->priority) {
-                        list_add_tail(&comp->list, &this->list);
+                        list_add(&comp->list, this->list.prev);
                         goto out;
                 }
         }
@@ -394,7 +394,7 @@ reinsert:
         list_del(&comp->list);
         list_for_each_entry(this, &jffs2_compressor_list, list) {
                 if (this->priority < comp->priority) {
-                        list_add_tail(&comp->list, &this->list);
+                        list_add(&comp->list, this->list.prev);
                         spin_unlock(&jffs2_compressor_list_lock);
                         return 0;
                 }

  parent reply	other threads:[~2006-03-31  3:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30  8:16 [patch 0/8] list.h related cleanups Akinobu Mita
2006-03-30  8:16 ` [patch 1/8] introduce hlist_move_head() Akinobu Mita
2006-03-30  8:16 ` [patch 2/8] use hlist_move_head() Akinobu Mita
2006-04-10  8:22   ` Andrew Morton
2006-04-10  9:53     ` Neil Brown
2006-03-30  8:16 ` [patch 3/8] use list_add_tail() instead of list_add() Akinobu Mita
2006-03-30  8:26   ` Karsten Keil
2006-03-30  8:30   ` Jan Kara
2006-03-30 10:25     ` David Woodhouse
2006-03-31  3:54   ` Akinobu Mita [this message]
2006-03-30  8:16 ` [patch 4/8] arch: use list_move() Akinobu Mita
2006-03-30  8:16 ` [patch 5/8] core: " Akinobu Mita
2006-03-30  8:16 ` [patch 6/8] net/rxrpc: " Akinobu Mita
2006-03-30 10:17   ` David Howells
2006-03-30  8:16 ` [patch 7/8] drivers: " Akinobu Mita
2006-03-30 12:11   ` Matthew Wilcox
2006-03-30  8:16 ` [patch 8/8] fs: " Akinobu Mita
2006-03-30  8:22   ` [-mm patch] reiser4fs: " Akinobu Mita
2006-03-30 10:18   ` [patch 8/8] fs: " David Howells
2006-03-30 19:07   ` Joel Becker
2006-04-03  1:04     ` Ian Kent
2006-03-30 19:15   ` Mark Fasheh

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=20060331035429.GA8767@miraclelinux.com \
    --to=mita@miraclelinux.com \
    --cc=akpm@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=jack@suse.cz \
    --cc=jaharkes@cs.cmu.edu \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sri@us.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox