From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 5/5] net: dsa: ksz: Add Microchip KSZ8795 DSA driver Date: Sat, 8 Dec 2018 12:52:32 +0100 Message-ID: <20181208115232.GE16502@lunn.ch> References: <20181207181845.21702-1-marex@denx.de> <20181207181845.21702-5-marex@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, Woojung.Huh@microchip.com, UNGLinuxDriver@microchip.com, Tristram Ha , "David S . Miller" To: Marek Vasut Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:38894 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbeLHLwf (ORCPT ); Sat, 8 Dec 2018 06:52:35 -0500 Content-Disposition: inline In-Reply-To: <20181207181845.21702-5-marex@denx.de> Sender: netdev-owner@vger.kernel.org List-ID: > +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