Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755574AbXLBNZJ (ORCPT ); Sun, 2 Dec 2007 08:25:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752952AbXLBNY5 (ORCPT ); Sun, 2 Dec 2007 08:24:57 -0500 Received: from mx1.redhat.com ([66.187.233.31]:57827 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbXLBNY4 (ORCPT ); Sun, 2 Dec 2007 08:24:56 -0500 Date: Sun, 2 Dec 2007 11:24:40 -0200 From: Arnaldo Carvalho de Melo To: Christer Weinigel Cc: Andy Whitcroft , linux-kernel@vger.kernel.org Subject: Re: [PATCH] teach checkpatch.pl about list_for_each Message-ID: <20071202132440.GM30008@ghostprotocols.net> Mail-Followup-To: Arnaldo Carvalho de Melo , Christer Weinigel , Andy Whitcroft , linux-kernel@vger.kernel.org References: <20071202130335.690a8daf@cw05lap> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071202130335.690a8daf@cw05lap> X-Url: http://oops.ghostprotocols.net:81/blog User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1388 Lines: 37 Em Sun, Dec 02, 2007 at 01:03:35PM +0100, Christer Weinigel escreveu: > Hi Andy, > > you seem to be the last person messing around with checkpatch.pl so I'm > addressing this to you. :-) > > checkpatch complains about the following: > > WARNING: no space between function name and open parenthesis '(' > #520: FILE: drivers/spi/spi_s3c24xx_dma.c:478: > + list_for_each_entry (transfer, &message->transfers, transfer_list) { > > which I think is a bit bogus since it actually is a for statement in > disguise. The following patch adds list_for_each to the list of things > that look like functions that it shouldn't complain about. Then you would have to do this for tons other *_for_each*, such as hlist_for_each, etc, but: [acme@doppio net-2.6.25]$ find . -name "*.[ch]" | xargs grep '_for_each[a-z_]*(' | wc -l 4370 [acme@doppio net-2.6.25]$ find . -name "*.[ch]" | xargs grep '_for_each[a-z_]* (' | wc -l 160 [acme@doppio net-2.6.25]$ I'd say that the common practice in the * _for_each_* use is to do just what checkpatch does right now, complain if the is a space. Ah, and that is also my personal preference 8-) - Arnaldo -- 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/