Subject: Re: [PATCH 5/5] net: dsa: ksz: Add Microchip KSZ8795 DSA driver

From: Andrew Lunn <[email-masked]>
Date: Sat, 8 Dec 2018 12:52:32 +0100

> +static int ksz8795_valid_dyn_entry(struct ksz_device *dev, u8 *data)
> +{
> +	int timeout = 100;
> +
> +	do {
> +		ksz_read8(dev, REG_IND_DATA_CHECK, data);
> +		timeout--;
> +	} while ((*data & DYNAMIC_MAC_TABLE_NOT_READY) && timeout);

readx_poll_timeout()?

> +static inline void ksz8795_from_vlan(u16 vlan, u8 *fid, u8 *member, u8 *valid)

Please don't use inline in C code, just in headers. Leave the compile
to decide if it should be inlined.

> +static void ksz8795_r_vlan_table(struct ksz_device *dev, u16 vid, u16 *vlan)
> +{
> +	u64 buf;
> +	u16 *data = (u16 *)&buf;
> +	u16 addr;
> +	int index;

The networking code uses reverse christmas tree. So you need to change
the order of these declarations, and do the assignment in the body of
the function. Please review all the functions.

> +static const u8 stp_multicast_addr[] = {
> +	0x01, 0x80, 0xC2, 0x00, 0x00, 0x00
> +};

include/linux/etherdevice.h defines eth_stp_addr.

	    Andrew