From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Mon, 20 Aug 2012 15:21:49 -0400 Subject: [U-Boot] [PATCH v2] net: asix: add support for AX88772B In-Reply-To: <1345485138-8511-1-git-send-email-dev@lynxeye.de> References: <1345485138-8511-1-git-send-email-dev@lynxeye.de> Message-ID: <201208201521.50768.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday 20 August 2012 13:52:18 Lucas Stach wrote: > + memset(buf, 0, ETH_ALEN); this memset is pointless > + for (i = 0; i < (ETH_ALEN >> 1); i++) { > + memset(read_buf, 0, 2); this memset is pointless > + memcpy((buf + i*2), read_buf, 2); use spaces: "i * 2" > + debug("MAC read from EEPROM: %02x:%02x:%02x:%02x:%02x:%02x\n", > + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]); use %pM instead of spelling out each byte yourself > + if (asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN, buf)) { > + printf("Failed to set MAC address.\n"); > + return -1; > + } > + > + return 0; > +} ret = asix_write_cmd(...) if (ret) puts(...); return ret; > static struct asix_dongle asix_dongles[] = { this probably should be const > --- a/include/usb_ether.h > +++ b/include/usb_ether.h > > +#ifdef CONFIG_USB_ETHER_ASIX > + int asix_flags; > +#endif > }; looks like the usb ether stack is fundamentally flawed if drivers are allowed to screw with the structure. this is what "void *priv" fields are for. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: