All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: xen/pciback: Drop two backends, squash and cleanup some code.
Date: Mon, 1 Dec 2014 10:36:57 -0500	[thread overview]
Message-ID: <20141201153657.GC3180@laptop.dumpdata.com> (raw)
In-Reply-To: <20141031153000.GA19229@mwanda>

On Fri, Oct 31, 2014 at 06:30:01PM +0300, Dan Carpenter wrote:
> 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?

Because all the other 'init' could. And 'bar_init' for example
returns the BAR value (wrapped in 'struct pci_bar_info').
> 
>    160          }
>    161  
>    162  out:
>    163          return ERR_PTR(err);
>    164  }
> 
> regards,
> dan carpenter

      reply	other threads:[~2014-12-01 22:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:30 xen/pciback: Drop two backends, squash and cleanup some code Dan Carpenter
2014-12-01 15:36 ` Konrad Rzeszutek Wilk [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=20141201153657.GC3180@laptop.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=dan.carpenter@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.