[U-Boot] [u-boot-release] [PATCH 3/6] powerpc/85xx: introduce function serdes_device_from_fm_port()

Kim Phillips kim.phillips at freescale.com
Mon Aug 13 23:10:01 CEST 2012


please don't post patches upstream with '[u-boot-release]' in the
subject.

On Fri, 10 Aug 2012 17:01:33 -0500
Timur Tabi <timur at freescale.com> wrote:

> +enum srds_prtcl serdes_device_from_fm_port(enum fm_port port)
> +{
> +	switch (port) {
> +	case FM1_DTSEC1:
> +		return SGMII_FM1_DTSEC1;
> +	case FM1_DTSEC2:
> +		return SGMII_FM1_DTSEC2;
> +	case FM1_DTSEC3:
> +		return SGMII_FM1_DTSEC3;
> +	case FM1_DTSEC4:
> +		return SGMII_FM1_DTSEC4;
> +	case FM1_DTSEC5:
> +		return SGMII_FM1_DTSEC5;
> +	case FM1_10GEC1:
> +		return XAUI_FM1;
> +	case FM2_DTSEC1:
> +		return SGMII_FM2_DTSEC1;
> +	case FM2_DTSEC2:
> +		return SGMII_FM2_DTSEC2;
> +	case FM2_DTSEC3:
> +		return SGMII_FM2_DTSEC3;
> +	case FM2_DTSEC4:
> +		return SGMII_FM2_DTSEC4;
> +	case FM2_DTSEC5:
> +		return SGMII_FM2_DTSEC5;
> +	case FM2_10GEC1:
> +		return XAUI_FM2;
> +	default:
> +		return NONE;
> +	}
> +}

shouldn't this be a static const array lookup?

Kim



More information about the U-Boot mailing list