From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756720AbZCOEzV (ORCPT ); Sun, 15 Mar 2009 00:55:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751066AbZCOEzH (ORCPT ); Sun, 15 Mar 2009 00:55:07 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:33645 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750874AbZCOEzE (ORCPT ); Sun, 15 Mar 2009 00:55:04 -0400 Date: Sun, 15 Mar 2009 05:54:46 +0100 From: Ingo Molnar To: Li Zefan Cc: Jaswinder Singh Rajput , x86 maintainers , LKML Subject: Re: [PATCH -tip] x86: kdebugfs.c cleanup Message-ID: <20090315045446.GD11150@elte.hu> References: <1237042917.4546.15.camel@ht.satnam> <49BC8182.5050508@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49BC8182.5050508@cn.fujitsu.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Li Zefan wrote: > > #include > > #include > > -#include > > +#include > > #include > > +#include > > #include > > #include > > -#include > > > > Just curious about the rule to sort those includes, and why they need > to be rearranged. Such includes (the 'reverse christmas tree'): #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include are used by x86 architecture code (and some other subsystems) to reduce the likelyhood of patch conflicts in commonly modified kernel files. Without such ordering developers typically append to the existing list of include files when introducing a new header - creating an almost certain patch conflict. Via the above ordering, new headers get distributed roughly evenly amongst the full range - and thus the chance of patch conflicts is much smaller. This way it also looks a bit more structured and bit less messy. It looks unprofessional and sloppy if a .c file starts with a big block of thrown-together include files. Ingo