Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808AbcCDKxX (ORCPT ); Fri, 4 Mar 2016 05:53:23 -0500 Received: from smtp-out4.electric.net ([192.162.216.195]:54028 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbcCDKxR (ORCPT ); Fri, 4 Mar 2016 05:53:17 -0500 From: David Laight To: "'John Crispin'" , "David S. Miller" CC: "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "Steven Liu (???)" , "Carlos Huang (???)" , Felix Fietkau , Michael Lee Subject: RE: [PATCH V3 2/4] net-next: mediatek: add support for MT7623 ethernet Thread-Topic: [PATCH V3 2/4] net-next: mediatek: add support for MT7623 ethernet Thread-Index: AQHRdYdrMr8nDh6zkUyO4eKF+0uF859JGthg Date: Fri, 4 Mar 2016 10:50:01 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D41114A26@AcuExch.aculab.com> References: <1457035361-57669-1-git-send-email-blogic@openwrt.org> <1457035361-57669-3-git-send-email-blogic@openwrt.org> In-Reply-To: <1457035361-57669-3-git-send-email-blogic@openwrt.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="ks_c_5601-1987" MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u24ArWpH031331 Content-Length: 674 Lines: 27 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