linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Aaron Lu <aaron.lu@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	<linux-pm@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Aaron Lu <aaron.lwe@gmail.com>,
	Shane Huang <shane.huang@amd.com>
Subject: Re: [PATCH v8 4/4] sd: change to auto suspend mode
Date: Fri, 1 Feb 2013 10:11:43 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1302011011090.1752-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20130201031944.GA6960@aaronlu.sh.intel.com>

On Fri, 1 Feb 2013, Aaron Lu wrote:

> On Thu, Jan 31, 2013 at 10:13:05AM -0500, Alan Stern wrote:
> > On Thu, 31 Jan 2013, Aaron Lu wrote:
> > 
> > > > > +static int scsi_blk_runtime_suspend(struct device *dev)
> > > > > +{
> > > > > +	struct scsi_device *sdev = to_scsi_device(dev);
> > > > 
> > > > For this routine and the other new ones, it may be slightly more
> > > > efficient to pass both dev and sdev as arguments (this depends on how
> > > > smart the compiler's optimizer is).  The caller already knows both of
> > > > them, after all.
> > > 
> > > What about passing only scsi_device? When device is needed, I can use
> > > &sdev->sdev_gendev. Is this equally efficient?
> > 
> > I don't know...  The difference is very small in any case.  The 
> > routines will probably be inlined automatically.
> 
> Indeed, I just checked the .s output of the three cases, they are all
> the same. So we just need to care about readability and less of code,
> passing only scsi_device seems to be the simplest, are you OK with this?

Yes, that's fine.  Thanks for checking it out.

Alan Stern


      reply	other threads:[~2013-02-01 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  9:34 [PATCH v8 0/4] block layer runtime pm Aaron Lu
2013-01-30  9:34 ` [PATCH v8 1/4] block: add a flag to identify PM request Aaron Lu
2013-01-30  9:34 ` [PATCH v8 2/4] block: add runtime pm helpers Aaron Lu
2013-01-30 15:54   ` Alan Stern
2013-01-31  5:35     ` Aaron Lu
2013-01-31 15:09       ` Alan Stern
2013-01-30  9:34 ` [PATCH v8 3/4] block: implement runtime pm strategy Aaron Lu
2013-01-30  9:34 ` [PATCH v8 4/4] sd: change to auto suspend mode Aaron Lu
2013-01-30 15:38   ` Alan Stern
2013-01-31  5:43     ` Aaron Lu
2013-01-31 15:13       ` Alan Stern
2013-02-01  3:19         ` Aaron Lu
2013-02-01 15:11           ` Alan Stern [this message]

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=Pine.LNX.4.44L0.1302011011090.1752-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=aaron.lu@intel.com \
    --cc=aaron.lwe@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=shane.huang@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).