linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Sean Anderson <seanga2@gmail.com>,
	Simon Horman <horms@kernel.org>,
	 Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	 kernel test robot <lkp@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Linux Memory Management List <linux-mm@kvack.org>,
	linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
Date: Thu, 6 Apr 2023 14:10:44 +0200	[thread overview]
Message-ID: <CAMuHMdUfmwPioxz3sbcYfw0iaBBfKG0Vx-cpNHtLF+MT5SSyFQ@mail.gmail.com> (raw)
In-Reply-To: <ZC2/Pi+M4rWw89x2@casper.infradead.org>

Hi Willy,

On Wed, Apr 5, 2023 at 8:34 PM Matthew Wilcox <willy@infradead.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@linux-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


  parent reply	other threads:[~2023-04-06 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 17:29 Simon Horman
2023-04-05 17:34 ` Sean Anderson
2023-04-05 18:02   ` Simon Horman
2023-04-05 18:07     ` Matthew Wilcox
2023-04-05 18:09       ` Sean Anderson
2023-04-05 18:34         ` Matthew Wilcox
2023-04-05 23:25           ` Jakub Kicinski
2023-04-06 12:10           ` Geert Uytterhoeven [this message]
2023-04-07  2:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUfmwPioxz3sbcYfw0iaBBfKG0Vx-cpNHtLF+MT5SSyFQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=seanga2@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox