[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171205103835.6fb9192f@windsurf.lan>
Date: Tue, 5 Dec 2017 10:38:35 +0100
From: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
"David S. Miller" <davem@...emloft.net>,
Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Simon Horman <horms+renesas@...ge.net.au>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH 1/2] net: sh_eth: use correct "struct device" when
calling DMA mapping functions
Hello,
On Tue, 5 Dec 2017 09:39:35 +0100, Geert Uytterhoeven wrote:
> > Using 'ndev->dev.parent' (as in ravb) also should work... not sure which
> > is better
>
> That was going to be my comment, too. I also haven't checked which
> generates the smallest code.
Using ndev->dev.parent actually generates bigger code (44 bytes larger) :
$ size drivers/net/ethernet/renesas/sh_eth.o.*
text data bss dec hex filename
27803 696 0 28499 6f53 drivers/net/ethernet/renesas/sh_eth.o.new
27759 696 0 28455 6f27 drivers/net/ethernet/renesas/sh_eth.o.orig
.orig is my original proposal, .new is with ndev->dev.parent. I'm using
a gcc 6.4.0 compiler.
Note also that the driver is already using mdp->pdev->dev all over the place:
$ grep -- mdp-\>pdev-\>dev drivers/net/ethernet/renesas/sh_eth.c
pm_wakeup_event(&mdp->pdev->dev, 0);
pm_runtime_get_sync(&mdp->pdev->dev);
pm_runtime_put_sync(&mdp->pdev->dev);
device_set_wakeup_enable(&mdp->pdev->dev, mdp->wol_enabled);
pm_runtime_get_sync(&mdp->pdev->dev);
pm_runtime_put_sync(&mdp->pdev->dev);
pm_runtime_put_sync(&mdp->pdev->dev);
struct device *dev = &mdp->pdev->dev;
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Powered by blists - more mailing lists