Re: [PATCH iproute2 net-next-for-3.13 2/2] iplink_bond: add support for displaying bond slave attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Feb 2014 09:11:56 +0100 (CET)
Michal Kubecek <mkubecek@xxxxxxx> wrote:

> +static const char *slave_state_tbl[] = {
> +	"active",
> +	"backup",
> +	NULL
> +};
> +
> +static const char *slave_mii_status_tbl[] = {
> +	"up",
> +	"going_down",
> +	"down",
> +	"going_back",
> +	NULL,
> +};
> +

Is there some correlation of these states to values in a header file.
Something like

static const char *slave_mii_status_tbl[] = {
	[BOND_LINK_UP] = "active",
	[BOND_LINK_FAIL] = "fail",
	[BOND_LINK_DOWN] = "down",
	[BOND_LINK_BACK] = "back",
};


And don't use null terminated arrays, use ARRAY_SIZE() instead.
	
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Discussion]     [TCP Instrumentation]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux WPAN Networking]     [Linux Host AP]     [Linux WPAN Networking]     [Linux Bluetooth Networking]     [Linux ATH6KL Networking]     [Linux Networking Users]     [Linux Coverity]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux IDE]     [Linux RAID]     [Linux SCSI]