From: Magnus Lilja <lilja.magnus@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] smc911x_eeprom: new example app for managing newer SMC parts
Date: Mon, 5 Jan 2009 16:23:56 +0100 [thread overview]
Message-ID: <59b21cf20901050723u313c670bt8491d237cd32b690@mail.gmail.com> (raw)
In-Reply-To: <1229932567-10682-2-git-send-email-vapier@gentoo.org>
Hi
I forgot to include some comments on the code, sorry about the noise.
2008/12/22 Mike Frysinger <vapier@gentoo.org>:
> A forward port of the last version to work with the newer smc911x driver.
> I only have a board with a LAN9218 part on it, so that is the only one
> I've tested. But there isn't anything in this that would make it terribly
> chip specific afaik.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> CC: Sascha Hauer <s.hauer@pengutronix.de>
> CC: Guennadi Liakhovetski <lg@denx.de>
> CC: Magnus Lilja <lilja.magnus@gmail.com>
> CC: Ben Warren <biggerbadderben@gmail.com>
> ---
> examples/.gitignore | 1 +
> examples/Makefile | 7 +-
> examples/smc911x_eeprom.c | 381 +++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 386 insertions(+), 3 deletions(-)
> diff --git a/examples/smc911x_eeprom.c b/examples/smc911x_eeprom.c
> new file mode 100644
> index 0000000..3dac4d3
> --- /dev/null
> +++ b/examples/smc911x_eeprom.c
<...>
> +static void print_macaddr(void)
> +{
> + puts("Current MAC Address in MAC: ");
> + ulong addrl = smc911x_get_mac_csr(ADDRL);
> + ulong addrh = smc911x_get_mac_csr(ADDRH);
> + printf("%02x:%02x:%02x:%02x:%02x:%02x\n",
> + (u8)(addrl), (u8)(addrl >> 8), (u8)(addrl >> 16),
> + (u8)(addrl >> 24), (u8)(addrh), (u8)(addrh >> 8));
> +
> + puts("Current MAC Address in EEPROM: ");
> + int i;
> + for (i = 1; i < 6; ++i)
> + printf("%02x:", read_eeprom_reg(i));
> + printf("%02x\n", read_eeprom_reg(i));
> +}
The above function declares new variables in the middle of the code.
Is this OK w.r.t. the coding standard? I haven't seen such code in
U-boot (or Linux) before.
/Magnus
next prev parent reply other threads:[~2009-01-05 15:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-22 7:56 [U-Boot] [PATCH 1/2] smc911x: split out useful defines/functions into local header Mike Frysinger
2008-12-22 7:56 ` [U-Boot] [PATCH 2/2] smc911x_eeprom: new example app for managing newer SMC parts Mike Frysinger
2009-01-05 15:17 ` Magnus Lilja
2009-01-05 15:23 ` Magnus Lilja [this message]
2009-02-17 23:35 ` Wolfgang Denk
2009-01-05 15:13 ` [U-Boot] [PATCH 1/2] smc911x: split out useful defines/functions into local header Magnus Lilja
2009-01-06 16:34 ` [U-Boot] [PATCH v2] " Mike Frysinger
2009-02-17 23:37 ` Wolfgang Denk
2009-02-23 6:56 ` Ben Warren
2009-02-23 15:29 ` [U-Boot] [PATCH v3] " Mike Frysinger
2009-02-23 15:44 ` Guennadi Liakhovetski
2009-02-23 15:47 ` Mike Frysinger
2009-02-23 16:09 ` Guennadi Liakhovetski
2009-02-25 7:17 ` Ben Warren
2009-02-25 8:01 ` Wolfgang Denk
2009-02-25 8:00 ` Wolfgang Denk
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=59b21cf20901050723u313c670bt8491d237cd32b690@mail.gmail.com \
--to=lilja.magnus@gmail.com \
--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