All of lore.kernel.org
 help / color / mirror / Atom feed
From: dan.carpenter@oracle.com (Dan Carpenter)
Subject: NVMe: Add pci suspend/resume driver callbacks
Date: Thu, 8 May 2014 21:19:52 +0300	[thread overview]
Message-ID: <20140508181952.GA4963@mwanda> (raw)
In-Reply-To: <alpine.LRH.2.03.1405080845480.5666@AMR>

On Thu, May 08, 2014@09:08:22AM -0600, Keith Busch wrote:
> Hi Dan,
> 
> On Thu, 8 May 2014, Dan Carpenter wrote:
> >  797          if (!nvmeq) {
> >  798                  put_nvmeq(NULL);
> >                                 ^^^^
> >You can't pass a NULL to put_nvmeq(), it will just Oops.
> 
> Does it? Let's follow this through:
> 
> static void put_nvmeq(struct nvme_queue *nvmeq) __releases(RCU)
> {
> 	rcu_read_unlock();
> 	put_cpu_var(nvmeq->dev->io_queue);
> }
> 
> This will use 'NULL' in put_cpu_var, and here's that macro:
> 
> #define put_cpu_var(var) do {                           \
> 	(void)&(var);                                   \
> 	preempt_enable();                               \
> } while (0)
> 
> That's a no-op, right?

Interesting.  You're right it's not a problem to pass the NULL pointer
here.

regards,
dan carpenter

  reply	other threads:[~2014-05-08 18:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140508125504.GA4973@mwanda>
2014-05-08 15:08 ` NVMe: Add pci suspend/resume driver callbacks Keith Busch
2014-05-08 18:19   ` Dan Carpenter [this message]
2014-05-09 14:01   ` Matthew Wilcox

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=20140508181952.GA4963@mwanda \
    --to=dan.carpenter@oracle.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.