lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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