Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbdGHG4r (ORCPT ); Sat, 8 Jul 2017 02:56:47 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:47736 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751175AbdGHG4q (ORCPT ); Sat, 8 Jul 2017 02:56:46 -0400 Message-ID: <1499497001.16278.19.camel@mtkswgap22> Subject: Re: [PATCH] net: ethernet: mediatek: remove useless code in mtk_probe() From: Sean Wang To: "Gustavo A. R. Silva" CC: Andrew Lunn , Felix Fietkau , "John Crispin" , Matthias Brugger , , , , Date: Sat, 8 Jul 2017 14:56:41 +0800 In-Reply-To: <20170707202333.GA5114@embeddedgus> References: <20170707202333.GA5114@embeddedgus> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 50 Hi, Gustavo It indeed is useless at the current time point. but actually I will add new SoC support to the driver in the next week, which requires the variable match :-( Sean On Fri, 2017-07-07 at 15:23 -0500, Gustavo A. R. Silva wrote: > Remove useless local variables _match_, _soc_ and the code related. > > Notice that > > const struct of_device_id of_mtk_match[] = { > { .compatible = "mediatek,mt2701-eth" }, > {}, > }; > > So match->data is NULL. > > Suggested-by: Andrew Lunn > Signed-off-by: Gustavo A. R. Silva > --- > drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > index adaaafc..b9a5a65 100644 > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > @@ -2401,15 +2401,10 @@ static int mtk_probe(struct platform_device *pdev) > { > struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > struct device_node *mac_np; > - const struct of_device_id *match; > - struct mtk_soc_data *soc; > struct mtk_eth *eth; > int err; > int i; > > - match = of_match_device(of_mtk_match, &pdev->dev); > - soc = (struct mtk_soc_data *)match->data; > - > eth = devm_kzalloc(&pdev->dev, sizeof(*eth), GFP_KERNEL); > if (!eth) > return -ENOMEM;