Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754554AbbLJPKl (ORCPT ); Thu, 10 Dec 2015 10:10:41 -0500 Received: from mail-oi0-f45.google.com ([209.85.218.45]:35941 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754476AbbLJPKh (ORCPT ); Thu, 10 Dec 2015 10:10:37 -0500 Subject: Re: [PATCH 1/4] list: introduce list_is_first() To: Geliang Tang , "Paul E. McKenney" , Jan Kara , Josef Bacik , Josh Triplett References: <305feb971ae11e192f35f25d66bb7b2e28e06c39.1449755818.git.geliangtang@163.com> Cc: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik , Pablo Neira Ayuso , Patrick McHardy , Jozsef Kadlecsik , "David S. Miller" , live-patching@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org From: Jens Axboe Message-ID: <566995EA.80509@kernel.dk> Date: Thu, 10 Dec 2015 08:10:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <305feb971ae11e192f35f25d66bb7b2e28e06c39.1449755818.git.geliangtang@163.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 780 Lines: 20 On 12/10/2015 07:17 AM, Geliang Tang wrote: > We already have list_is_last(), it makes sense to also add > list_is_first() for consistency. This list utility function > to check for first element in a list. Honestly, I think we already have way too many of these kind of helpers. IMHO they don't really help, they hurt readability. You should know how the list works anyway, and if you do, then it's a no-brainer what's first and last. If you don't, then you are bound to screw up in other ways. Just my 2 cents. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/