[PATCH net-next 2/2 v6] net: ethernet: Add a driver for Gemini gigabit ethernet

David Miller davem at davemloft.net
Sun Dec 3 15:21:49 PST 2017


From: Linus Walleij <linus.walleij at linaro.org>
Date: Sat,  2 Dec 2017 12:06:40 +0100

> +struct gmac_txq {
> +	GMAC_TXDESC_T	*ring;

Please don't create struct based typedef's, express this using
a straight "struct gmac_rxdesc_t", and also make it lowercase.

Uppercase names are reserved for CPP macros, and this is how
visually one can determine if something is a CPP macro in the
kernel sources.

Please fix this for your entire submission.

> +struct gemini_ethernet_port {
> +	unsigned int id; /* 0 or 1 */

A value taking on only 0 or 1 can be stored in a smaller type
such as 'u8'

> +		for (i = 0; i < RX_STATS_NUM; ++i)

Please always express this in the canonical way which is
to increment the index using "i++" post-postdecrement.

Please fix this for your entire submission.

> +static irqreturn_t gemini_port_irq_thread(int irq, void *data)
> +{
> +	struct gemini_ethernet_port *port = data;
> +	struct gemini_ethernet *geth = port->geth;
> +	unsigned long irqmask = SWFQ_EMPTY_INT_BIT;
> +	unsigned long flags;

Always order local variables in reverse-christmas-tree format,
which is longest to shortest line.

Again, please fix this for your entire submission.

Thank you.



More information about the linux-arm-kernel mailing list