>-----Original Message----- >From: Arnd Bergmann <a...@kernel.org> >Sent: Friday, December 4, 2020 12:37 AM [...] >Subject: [PATCH] enetc: fix build warning > >From: Arnd Bergmann <a...@arndb.de> > >When CONFIG_OF is disabled, there is a harmless warning about >an unused variable: > >enetc_pf.c: In function 'enetc_phylink_create': >enetc_pf.c:981:17: error: unused variable 'dev' [-Werror=unused-variable] > >Slightly rearrange the code to pass around the of_node as a >function argument, which avoids the problem without hurting >readability. > >Fixes: 71b77a7a27a3 ("enetc: Migrate to PHYLINK and PCS_LYNX") >Signed-off-by: Arnd Bergmann <a...@arndb.de>
Very nice cleanup, the code looks much better like this. For some reason this patch is marked as "Not applicable" in patchwork. So I took the patch, made a small cosmetic change (see nit below), added a more verbose subject line, tested and resent it, patchwork link here: https://patchwork.ozlabs.org/project/netdev/patch/20201204120800.17193-1-claudiu.man...@nxp.com/ Thanks. >--- > .../net/ethernet/freescale/enetc/enetc_pf.c | 21 +++++++++---------- >@@ -1005,9 +1003,10 @@ static int enetc_pf_probe(struct pci_dev *pdev, > struct net_device *ndev; > struct enetc_si *si; > struct enetc_pf *pf; >+ struct device_node *node = pdev->dev.of_node; Nit: move this long line to the top (reverse tree)