Re: [RFC PATCH net-next 4/7] net: sunhme: Alphabetize includes

From: Simon Horman
Date: Sat Feb 25 2023 - 16:08:11 EST


On Wed, Feb 22, 2023 at 04:03:52PM -0500, Sean Anderson wrote:
> Alphabetize includes to make it clearer where to add new ones.
>
> Signed-off-by: Sean Anderson <seanga2@xxxxxxxxx>
> ---
>
> drivers/net/ethernet/sun/sunhme.c | 45 +++++++++++++++----------------
> 1 file changed, 22 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index 127253c67c59..ab39b555d9f7 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -14,41 +14,40 @@
> * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
> */
>
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> +#include <asm/byteorder.h>
> +#include <asm/dma.h>
> +#include <linux/bitops.h>
> +#include <linux/crc32.h>
> +#include <linux/delay.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/errno.h>
> +#include <linux/etherdevice.h>
> +#include <linux/ethtool.h>
> #include <linux/fcntl.h>
> -#include <linux/interrupt.h>
> -#include <linux/ioport.h>
> #include <linux/in.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> -#include <linux/delay.h>
> #include <linux/init.h>
> -#include <linux/ethtool.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/ioport.h>
> +#include <linux/kernel.h>
> #include <linux/mii.h>
> -#include <linux/crc32.h>
> -#include <linux/random.h>
> -#include <linux/errno.h>
> +#include <linux/mm.h>
> +#include <linux/module.h>
> #include <linux/netdevice.h>
> -#include <linux/etherdevice.h>
> +#include <linux/random.h>
> #include <linux/skbuff.h>
> -#include <linux/mm.h>
> -#include <linux/bitops.h>
> -#include <linux/dma-mapping.h>
> -
> -#include <asm/io.h>
> -#include <asm/dma.h>
> -#include <asm/byteorder.h>
> +#include <linux/slab.h>
> +#include <linux/string.h>
> +#include <linux/types.h>
>
> #ifdef CONFIG_SPARC
> -#include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <asm/auxio.h>
> #include <asm/idprom.h>
> #include <asm/openprom.h>
> #include <asm/oplib.h>
> #include <asm/prom.h>
> -#include <asm/auxio.h>
> +#include <linux/of_device.h>
> +#include <linux/of.h>

A nice cleanup, IMHO.
But can linux/ includes also moved out of the ifdefs.

> #endif
> #include <linux/uaccess.h>

And, perhaps it would be nice to further move things around so there are
three groups of includes:

* <asm/*.h>
- non #ifdef CONFIG_SPARC; and
- #ifdef CONFIG_SPARC
* <linux/*>
* "*.h"