All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: konrad.wilk@oracle.com
Cc: xen-devel@lists.xenproject.org
Subject: Re: xen/pciback: Drop two backends, squash and cleanup some code.
Date: Fri, 31 Oct 2014 18:30:01 +0300	[thread overview]
Message-ID: <20141031153000.GA19229@mwanda> (raw)

Hello Konrad Rzeszutek Wilk,

The patch a92336a1176b: "xen/pciback: Drop two backends, squash and
cleanup some code." from Jul 19, 2011, leads to the following static
checker warning:

	drivers/xen/xen-pciback/conf_space_capability.c:163 pm_ctrl_init()
	error: passing non negative 135 to ERR_PTR

drivers/xen/xen-pciback/conf_space_capability.c
   147  /* Ensure PMEs are disabled */
   148  static void *pm_ctrl_init(struct pci_dev *dev, int offset)
   149  {
   150          int err;
   151          u16 value;
   152  
   153          err = pci_read_config_word(dev, offset, &value);
   154          if (err)
   155                  goto out;
   156  
   157          if (value & PCI_PM_CTRL_PME_ENABLE) {
   158                  value &= ~PCI_PM_CTRL_PME_ENABLE;
   159                  err = pci_write_config_word(dev, offset, value);

The static check is complaining that pci_write_config_word() can
return PCIBIOS_BAD_REGISTER_NUMBER, but actually I think that's not
possible.

Anyway, this function is only called from
xen_pcibk_config_add_field_offset() so why are we returning a pointer
instead of just int?

   160          }
   161  
   162  out:
   163          return ERR_PTR(err);
   164  }

regards,
dan carpenter

             reply	other threads:[~2014-10-31 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:30 Dan Carpenter [this message]
2014-12-01 15:36 ` xen/pciback: Drop two backends, squash and cleanup some code Konrad Rzeszutek Wilk

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=20141031153000.GA19229@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.