[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151210153540.GA27533@infradead.org>
Date: Thu, 10 Dec 2015 07:35:40 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>, Geliang Tang <geliangtang@....com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Jan Kara <jack@...e.cz>, Josef Bacik <jbacik@...com>,
Josh Triplett <josh@...htriplett.org>,
Seth Jennings <sjenning@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Vojtech Pavlik <vojtech@...e.com>,
Pablo Neira Ayuso <pablo@...filter.org>,
Patrick McHardy <kaber@...sh.net>,
Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
"David S. Miller" <davem@...emloft.net>,
live-patching@...r.kernel.org, netfilter-devel@...r.kernel.org,
coreteam@...filter.org, netdev@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] list: introduce list_is_first()
On Thu, Dec 10, 2015 at 09:23:57AM -0600, Josh Poimboeuf wrote:
> Personally I would disagree. Something like:
>
> if (list_is_first(&rq->queuelist, &nd->queue))
>
> is much more readable to me than:
>
> if (rq->queuelist.prev == &nd->queue)
>
> The first one takes no effort for me -- it's almost English. While the
> second one takes me a few seconds (and some precious brain cycles) to
> decipher.
>
> Maybe whether it's readable depends on how many years you've been
> looking at the pattern. But IMHO we shouldn't make "having x # of years
> staring at kernel code" a prerequisite for being able to read kernel
> code.
I think understanding the list.h semantics is a requirement for writing
(or reading) non-trivial kernel code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists