Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes

From: Matthew Wilcox
Date: Wed Apr 05 2023 - 14:34:54 EST


On Wed, Apr 05, 2023 at 02:09:55PM -0400, Sean Anderson wrote:
> On 4/5/23 14:07, Matthew Wilcox wrote:
> > We always include linux/* headers before asm/*. The "sorting" of
> > headers in this way was inappropriate.
>
> Is this written down anywhere? I couldn't find it in Documentation/process...

Feel free to send a patch. Generally, it should be:

#include <linux/foo.h>
#include <linux/bar.h>

#include <asm/baz.h>
#include <asm/quux.h>

#include "local.h"

Some drivers do this a different way with a single local.h that includes
all necessary includes.

Also if <linux/foo.h> and <asm/foo.h> both exist, you should include
<linux/foo.h> (which almost certainly includes <asm/foo.h>)