From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] net: asix: add support for AX88772B
Date: Mon, 20 Aug 2012 15:21:49 -0400 [thread overview]
Message-ID: <201208201521.50768.vapier@gentoo.org> (raw)
In-Reply-To: <1345485138-8511-1-git-send-email-dev@lynxeye.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: <http://lists.denx.de/pipermail/u-boot/attachments/20120820/7674ac37/attachment.pgp>
next prev parent reply other threads:[~2012-08-20 19:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 17:52 [U-Boot] [PATCH v2] net: asix: add support for AX88772B Lucas Stach
2012-08-20 18:27 ` Marek Vasut
2012-08-20 19:21 ` Mike Frysinger [this message]
2012-08-20 19:45 ` Joe Hershberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208201521.50768.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox