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] [day] [month] [year] [list]
Message-ID: <AM4PR0401MB22609781F54C6FC2F0AD22D4FF830@AM4PR0401MB2260.eurprd04.prod.outlook.com>
Date:   Mon, 5 Dec 2016 07:31:23 +0000
From:   Andy Duan <fugang.duan@....com>
To:     Nikita Yushchenko <nikita.yoush@...entembedded.com>,
        "David S. Miller" <davem@...emloft.net>,
        Troy Kisky <troy.kisky@...ndarydevices.com>,
        "Andrew Lunn" <andrew@...n.ch>, Eric Nelson <eric@...int.com>,
        Philippe Reynes <tremyfr@...il.com>,
        Johannes Berg <johannes@...solutions.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     Chris Healy <cphealy@...il.com>,
        Fabio Estevam <fabio.estevam@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [patch net] net: fec: fix compile with CONFIG_M5272

From: Nikita Yushchenko <nikita.yoush@...entembedded.com> Sent: Sunday, December 04, 2016 11:18 PM
 >To: David S. Miller <davem@...emloft.net>; Andy Duan
 ><fugang.duan@....com>; Troy Kisky <troy.kisky@...ndarydevices.com>;
 >Andrew Lunn <andrew@...n.ch>; Eric Nelson <eric@...int.com>; Philippe
 >Reynes <tremyfr@...il.com>; Johannes Berg <johannes@...solutions.net>;
 >netdev@...r.kernel.org
 >Cc: Chris Healy <cphealy@...il.com>; Fabio Estevam
 ><fabio.estevam@....com>; linux-kernel@...r.kernel.org; Nikita
 >Yushchenko <nikita.yoush@...entembedded.com>
 >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 <nikita.yoush@...entembedded.com>
 >---
 > 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ