[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUfmwPioxz3sbcYfw0iaBBfKG0Vx-cpNHtLF+MT5SSyFQ@mail.gmail.com>
Date: Thu, 6 Apr 2023 14:10:44 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Sean Anderson <seanga2@...il.com>, Simon Horman <horms@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
kernel test robot <lkp@...el.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Linux Memory Management List <linux-mm@...ck.org>,
linux-m68k@...ts.linux-m68k.org
Subject: Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
Hi Willy,
On Wed, Apr 5, 2023 at 8:34 PM Matthew Wilcox <willy@...radead.org> wrote:
> 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>)
Indeed. Usually <asm/foo.h> should not be included directly,
except for a few exceptions like <asm/irq.h>.
Witness e.g. the (violated a lot) comment at the top of include/linux/irq.h:
/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists