[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D41114A26@AcuExch.aculab.com>
Date:	Fri, 4 Mar 2016 10:50:01 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'John Crispin' <blogic@...nwrt.org>,
	"David S. Miller" <davem@...emloft.net>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-mediatek@...ts.infradead.org" 
	<linux-mediatek@...ts.infradead.org>,
	"Steven Liu (???)" <steven.liu@...iatek.com>,
	"Carlos Huang (???)" <Carlos.Huang@...iatek.com>,
	Felix Fietkau <nbd@...nwrt.org>, Michael Lee <igvtee@...il.com>
Subject: RE: [PATCH V3 2/4] net-next: mediatek: add support for MT7623
 ethernet
From: John Crispin
> Sent: 03 March 2016 20:03
...
> +/* ugly macro hack to make sure hw_stats and ethtool strings are consistent */
> +#define MTK_STAT_REG_DECLARE		\
> +	_FE(tx_bytes)			\
> +	_FE(tx_packets)			\
> +	_FE(tx_skip)			\
> +	_FE(tx_collisions)		\
> +	_FE(rx_bytes)			\
> +	_FE(rx_packets)			\
> +	_FE(rx_overflow)		\
> +	_FE(rx_fcs_errors)		\
> +	_FE(rx_short_errors)		\
> +	_FE(rx_long_errors)		\
> +	_FE(rx_checksum_errors)		\
> +	_FE(rx_flow_control_packets)
Much better is to replace the first line with:
#define MTK_STAT_REG__DECLARE(_FE)
then the calling code can do:
#define XX(x) #x,
const char *names = {MTK_STAT_REG_DECLARE(XX)};
#undef XX
	David
Powered by blists - more mailing lists
 
