Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492AbcLEK7B (ORCPT ); Mon, 5 Dec 2016 05:59:01 -0500 Received: from mail-db5eur01on0074.outbound.protection.outlook.com ([104.47.2.74]:48704 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751233AbcLEK67 (ORCPT ); Mon, 5 Dec 2016 05:58:59 -0500 X-Greylist: delayed 11537 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Dec 2016 05:58:58 EST From: Andy Duan To: Nikita Yushchenko , "David S. Miller" , Troy Kisky , "Andrew Lunn" , Eric Nelson , Philippe Reynes , Johannes Berg , "netdev@vger.kernel.org" CC: Chris Healy , Fabio Estevam , "linux-kernel@vger.kernel.org" Subject: RE: [patch net v2] net: fec: fix compile with CONFIG_M5272 Thread-Topic: [patch net v2] net: fec: fix compile with CONFIG_M5272 Thread-Index: AQHSTs/Y5XJ8fyvBf02B7Tbw0GdwN6D5EAgQ Date: Mon, 5 Dec 2016 09:08:24 +0000 Message-ID: References: <1480925763-20254-1-git-send-email-nikita.yoush@cogentembedded.com> In-Reply-To: <1480925763-20254-1-git-send-email-nikita.yoush@cogentembedded.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=fugang.duan@nxp.com; x-originating-ip: [199.59.231.64] x-ms-office365-filtering-correlation-id: 2bb870ce-2a16-4a7d-55d3-08d41cee4474 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0402MB2751; x-microsoft-exchange-diagnostics: 1;VI1PR0402MB2751;7:UwZCU+7FrvypL1PI8A/vvpKCgmY7ZZuvbTOK5NPsUSZO9T7btSv/NEQfwg2+D+XVxvDLyND3YrciOrdHCDtE4We2A4fFcb28/btwcG72w+tnfeHfW0bO6ew+Xi9c8jZc9prIV7c6PZ4dMCCqmp8xrOY2CGVE6zGzUn3GCrFWqFUC4hY96ONd8KwskZ6eJIhKpbysEf1OzfkSwgW0HfgHrxD3KpjObAKDarQ0Hg3tBRJJJoCR6/j3cYcRUrlZHDgJjKahg2xszsTkYo3qb5srZCG8j4/IZH7XE9WVs+ADCC+qjJEM9/PTXbKMV/O05MG7AIJv/TeJLPX2w7fZqWao8BECZ24xOVBd/FU6dPtUFJaXtrWd4w133GhLGfqq96kQEeeddMI9mZQX00tuiI99NvifXMYDH5JeUdn3SBUk3ib7uA7Ve0YfzC+YkjTLJOPA3HPO4UMJeijaDi6SB8HNzA== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6047074)(6072148);SRVR:VI1PR0402MB2751;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB2751; x-forefront-prvs: 0147E151B5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(377454003)(3846002)(229853002)(102836003)(105586002)(81166006)(106116001)(7416002)(2950100002)(81156014)(7846002)(7736002)(86362001)(7696004)(39840400001)(2900100001)(39860400001)(38730400001)(39060400001)(6116002)(39450400002)(77096006)(39410400001)(74316002)(305945005)(101416001)(92566002)(3660700001)(76576001)(66066001)(33656002)(3280700002)(50986999)(9686002)(54356999)(76176999)(8936002)(106356001)(4326007)(5001770100001)(189998001)(39850400001)(97736004)(8676002)(2501003)(6506006)(68736007)(122556002)(2906002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB2751;H:AM4PR0401MB2260.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2016 09:08:24.0800 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2751 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 quoted-printable to 8bit by mail.home.local id uB5AxMY3026007 Content-Length: 3185 Lines: 81 From: Nikita Yushchenko Sent: Monday, December 05, 2016 4:16 PM >To: David S. Miller ; Andy Duan >; Troy Kisky ; >Andrew Lunn ; Eric Nelson ; Philippe >Reynes ; Johannes Berg ; >netdev@vger.kernel.org >Cc: Chris Healy ; Fabio Estevam >; linux-kernel@vger.kernel.org; Nikita >Yushchenko >Subject: [patch net v2] net: fec: fix compile with CONFIG_M5272 > >Commit 4dfb80d18d05 ("net: fec: cache statistics while device is down") >introduced unconditional statistics-related actions. > >However, when driver is compiled with CONFIG_M5272, staticsics-related >definitions do not exist, which results into build errors. > >Fix that by adding explicit handling of !defined(CONFIG_M5272) case. > >Fixes: 4dfb80d18d05 ("net: fec: cache statistics while device is down") >Signed-off-by: Nikita Yushchenko >--- >Changes since v1: >- instead of #ifdef'ing calls to fec_enet_update_ethtool_stats(), add > definition of empty fec_enet_update_ethtool_stats() for CONFIG_M5272 > case, >- add FEC_STATS_SIZE macro to avoid #ifdef in the middle of > alloc_etherdev_mqs() args. > > drivers/net/ethernet/freescale/fec_main.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > Acked-by: Fugang Duan >diff --git a/drivers/net/ethernet/freescale/fec_main.c >b/drivers/net/ethernet/freescale/fec_main.c >index 5f77caa59534..741cf4a57bfc 100644 >--- a/drivers/net/ethernet/freescale/fec_main.c >+++ b/drivers/net/ethernet/freescale/fec_main.c >@@ -2313,6 +2313,8 @@ static const struct fec_stat { > { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, }; > >+#define FEC_STATS_SIZE (ARRAY_SIZE(fec_stats) * sizeof(u64)) >+ > static void fec_enet_update_ethtool_stats(struct net_device *dev) { > struct fec_enet_private *fep = netdev_priv(dev); @@ -2330,7 >+2332,7 @@ static void fec_enet_get_ethtool_stats(struct net_device *dev, > if (netif_running(dev)) > fec_enet_update_ethtool_stats(dev); > >- memcpy(data, fep->ethtool_stats, ARRAY_SIZE(fec_stats) * >sizeof(u64)); >+ memcpy(data, fep->ethtool_stats, FEC_STATS_SIZE); > } > > static void fec_enet_get_strings(struct net_device *netdev, @@ -2355,6 >+2357,12 @@ static int fec_enet_get_sset_count(struct net_device *dev, int >sset) > return -EOPNOTSUPP; > } > } >+ >+#else /* !defined(CONFIG_M5272) */ >+#define FEC_STATS_SIZE 0 >+static inline void fec_enet_update_ethtool_stats(struct net_device >+*dev) { } > #endif /* !defined(CONFIG_M5272) */ > > static int fec_enet_nway_reset(struct net_device *dev) @@ -3293,8 >+3301,7 @@ fec_probe(struct platform_device *pdev) > > /* Init network device */ > ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) + >- ARRAY_SIZE(fec_stats) * sizeof(u64), >- num_tx_qs, num_rx_qs); >+ FEC_STAT_SIZE, num_tx_qs, num_rx_qs); > if (!ndev) > return -ENOMEM; > >-- >2.1.4