public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [u-boot-release] [PATCH 3/6] powerpc/85xx: introduce function serdes_device_from_fm_port()
Date: Mon, 13 Aug 2012 16:22:01 -0500	[thread overview]
Message-ID: <50296FF9.8010407@freescale.com> (raw)
In-Reply-To: <20120813161001.03e179cda8b406a3fcc93b3b@freescale.com>

Kim Phillips wrote:
> please don't post patches upstream with '[u-boot-release]' in the
> subject.

I didn't.

http://lists.denx.de/pipermail/u-boot/2012-August/130618.html

Your mailer is confused.  I bcc the u-boot-release mailing list, and I
presume your mailer (or our mail server) sent you that copy of the mail
instead of the "real" one.

> shouldn't this be a static const array lookup?

The compiler should convert it into an array lookup automatically, but I
can change it if you insist.  Since I don't like writing code that depends
on the values of an enum, the array will look like this:

	static const enum srds_prtcl srds_table[] = {
		[FM1_DTSEC1] = SGMII_FM1_DTSEC1,
		[FM1_DTSEC2] = SGMII_FM1_DTSEC2,
		[FM1_DTSEC3] = SGMII_FM1_DTSEC3,
		[FM1_DTSEC4] = SGMII_FM1_DTSEC4,
		[FM1_DTSEC5] = SGMII_FM1_DTSEC5,
		[FM1_10GEC1] = XAUI_FM1,
		[FM2_DTSEC1] = SGMII_FM2_DTSEC1,
		[FM2_DTSEC2] = SGMII_FM2_DTSEC2,
		[FM2_DTSEC3] = SGMII_FM2_DTSEC3,
		[FM2_DTSEC4] = SGMII_FM2_DTSEC4,
		[FM2_DTSEC5] = SGMII_FM2_DTSEC5,
		[FM2_10GEC1] = XAUI_FM2,
	};

	if ((port < FM1_DTSEC1) || (port > FM2_10GEC1))
		return NONE;
	else
		return srds_table[port];

I'm not sure that's an improvement.

-- 
Timur Tabi
Linux kernel developer at Freescale

  reply	other threads:[~2012-08-13 21:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 22:01 [U-Boot] [PATCH 1/6] powerpc/85xx: add support for FM2 DTSEC5 Timur Tabi
2012-08-10 22:01 ` [U-Boot] [PATCH 2/6] fm-eth: add function fm_info_get_phy_address() Timur Tabi
2012-08-10 22:01 ` [U-Boot] [PATCH 3/6] powerpc/85xx: introduce function serdes_device_from_fm_port() Timur Tabi
2012-08-13 21:10   ` [U-Boot] [u-boot-release] " Kim Phillips
2012-08-13 21:22     ` Timur Tabi [this message]
2012-08-13 21:34       ` Kim Phillips
2012-08-13 21:41         ` Timur Tabi
2012-08-10 22:01 ` [U-Boot] [PATCH 4/6] fm-eth: use fdt_status_disabled() function in ft_fixup_port() Timur Tabi
2012-08-10 22:01 ` [U-Boot] [PATCH 5/6] powerpc/85xx: get rid of enum board_slots in P4080 MDIO driver Timur Tabi
2012-08-10 22:01 ` [U-Boot] [PATCH 6/6] powerpc/85xx: update P4080DS MDIO bus multiplexer support Timur Tabi

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=50296FF9.8010407@freescale.com \
    --to=timur@freescale.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