All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Simon Horman" <horms+renesas@verge.net.au>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 1/2] net: sh_eth: use correct "struct device" when calling DMA mapping functions
Date: Tue, 5 Dec 2017 10:38:35 +0100	[thread overview]
Message-ID: <20171205103835.6fb9192f@windsurf.lan> (raw)
In-Reply-To: <CAMuHMdVzzVZcR+oCJsHeuP-nyav=kMbjmipiJGfrY7s_DZ5qnQ@mail.gmail.com>

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

  reply	other threads:[~2017-12-05  9:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 13:33 [PATCH 0/2] net: sh_eth: DMA mapping API fixes Thomas Petazzoni
2017-12-04 13:33 ` [PATCH 1/2] net: sh_eth: use correct "struct device" when calling DMA mapping functions Thomas Petazzoni
2017-12-04 17:24   ` Sergei Shtylyov
2017-12-04 20:05   ` Sergei Shtylyov
2017-12-05  8:39     ` Geert Uytterhoeven
2017-12-05  9:38       ` Thomas Petazzoni [this message]
2017-12-05  9:39         ` Geert Uytterhoeven
2017-12-05  9:39           ` Geert Uytterhoeven
2017-12-05  8:36   ` Geert Uytterhoeven
2017-12-05  8:36     ` Geert Uytterhoeven
2017-12-04 13:33 ` [PATCH 2/2] net: sh_eth: don't use NULL as "struct device" for the DMA mapping API Thomas Petazzoni
2017-12-04 17:30   ` Sergei Shtylyov
2017-12-05  9:10   ` Geert Uytterhoeven
2017-12-05  9:10     ` Geert Uytterhoeven
2017-12-05 19:42 ` [PATCH 0/2] net: sh_eth: DMA mapping API fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171205103835.6fb9192f@windsurf.lan \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=davem@davemloft.net \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sergei.shtylyov@cogentembedded.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.