Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752226AbcLESpa (ORCPT ); Mon, 5 Dec 2016 13:45:30 -0500 Received: from mail-db5eur01on0051.outbound.protection.outlook.com ([104.47.2.51]:3719 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751378AbcLESp2 (ORCPT ); Mon, 5 Dec 2016 13:45:28 -0500 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] net: fec: fix compile with CONFIG_M5272 Thread-Topic: [patch net] net: fec: fix compile with CONFIG_M5272 Thread-Index: AQHSTkGh2oPrX8MPXUO8281+k76aw6D48v5A Date: Mon, 5 Dec 2016 07:31:23 +0000 Message-ID: References: <1480864677-15310-1-git-send-email-nikita.yoush@cogentembedded.com> In-Reply-To: <1480864677-15310-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: 5572115c-1e1a-4cab-5cdc-08d41ce0b6e4 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HE1PR0402MB2745; x-microsoft-exchange-diagnostics: 1;HE1PR0402MB2745;7:PtkVXzFvUptsJ5bLK7RUpMD3dq/EoGfWB/U9omz11XpRTxXejz2+GyWPAkLyvpRkpAWWkhzHyMgvlMvUyvBbmJ9pM2pMMIeJrzNyXDHvOdqATgkspLINJ1+RthgG+MxnWiNu2wgqF8gED/jglupoIzPVJpYa1/2OvE1kAhHiDH+F37HGnuewGQSbeHVZ+scptqW8GoSKUFf6wPxCiAvdoo3KXodmXpkImzzggV0dWfGqcKggDXg8kNcAR56ckJ896yI1bk7CQ9zIAwmc4GxuoSHfHvroqkJ0xR4QptT/4fDUAdRANrTzdCKrPEw8ff8NY6feG8a6QhZyJFNB/2xBlm43NKPNxiAD7MLyX36G88NAt5jBMRdiN3AoaCOH7jSdk+pnsoSFRFXTIuADJDHzv9bTyx10O/0zDb9MhMcXSHKdFJJalPliZLsQ2OsTBYfLfKzE0rt/mse7nyBCVJJYwQ== 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)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6047074)(6072148);SRVR:HE1PR0402MB2745;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0402MB2745; x-forefront-prvs: 0147E151B5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377454003)(199003)(189002)(8676002)(7846002)(2501003)(50986999)(106116001)(76176999)(54356999)(105586002)(106356001)(8936002)(39840400001)(92566002)(7736002)(7696004)(39860400001)(2950100002)(2906002)(2900100001)(305945005)(4326007)(81156014)(9686002)(81166006)(3280700002)(6116002)(189998001)(3660700001)(3846002)(76576001)(101416001)(74316002)(102836003)(66066001)(229853002)(122556002)(33656002)(39410400001)(39850400001)(39060400001)(77096006)(5001770100001)(38730400001)(39450400002)(7416002)(97736004)(68736007)(86362001)(5660300001)(6506006);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0402MB2745;H:AM4PR0401MB2260.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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 07:31:23.1963 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2745 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 uB5IjaF3012301 Content-Length: 2947 Lines: 78 From: Nikita Yushchenko Sent: Sunday, December 04, 2016 11:18 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] 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 needed #if !defined(CONFIG_M5272). > >Fixes: 4dfb80d18d05 ("net: fec: cache statistics while device is down") >Signed-off-by: Nikita Yushchenko >--- > drivers/net/ethernet/freescale/fec_main.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/drivers/net/ethernet/freescale/fec_main.c >b/drivers/net/ethernet/freescale/fec_main.c >index 6a20c24a2003..89e902767abb 100644 >--- a/drivers/net/ethernet/freescale/fec_main.c >+++ b/drivers/net/ethernet/freescale/fec_main.c >@@ -2884,7 +2884,9 @@ fec_enet_close(struct net_device *ndev) > if (fep->quirks & FEC_QUIRK_ERR006687) > imx6q_cpuidle_fec_irqs_unused(); > >+#if !defined(CONFIG_M5272) > fec_enet_update_ethtool_stats(ndev); >+#endif It is better to define fec_enet_update_ethtool_stats() for CONFIG_M5272 like static void fec_enet_update_ethtool_stats(struct net_device *dev){}, or directly return in .fec_enet_update_ethtool_stats(): @@ -2315,6 +2315,10 @@ static void fec_enet_update_ethtool_stats(struct net_device *dev) struct fec_enet_private *fep = netdev_priv(dev); int i; +#if defined(CONFIG_M5272) + return; +#endif + > > fec_enet_clk_enable(ndev, false); > pinctrl_pm_select_sleep_state(&fep->pdev->dev); >@@ -3192,7 +3194,9 @@ static int fec_enet_init(struct net_device *ndev) > > fec_restart(ndev); > >+#if !defined(CONFIG_M5272) > fec_enet_update_ethtool_stats(ndev); >+#endif > ditto > return 0; > } >@@ -3292,9 +3296,11 @@ fec_probe(struct platform_device *pdev) > fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs); > > /* Init network device */ >- ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) + >- ARRAY_SIZE(fec_stats) * sizeof(u64), >- num_tx_qs, num_rx_qs); >+ ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) #if >+!defined(CONFIG_M5272) >+ + ARRAY_SIZE(fec_stats) * sizeof(u64) >#endif >+ , num_tx_qs, num_rx_qs); > if (!ndev) > return -ENOMEM; > >-- >2.1.4