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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Willy,

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

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



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux