From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: xen/pciback: Drop two backends, squash and cleanup some code. Date: Mon, 1 Dec 2014 10:36:57 -0500 Message-ID: <20141201153657.GC3180@laptop.dumpdata.com> References: <20141031153000.GA19229@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XvZ8p-0004eS-2e for xen-devel@lists.xenproject.org; Mon, 01 Dec 2014 22:08:23 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sB1M8Jd6014804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Dec 2014 22:08:19 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id sB1M8IeU007463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 1 Dec 2014 22:08:19 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sB1M8IWJ028407 for ; Mon, 1 Dec 2014 22:08:18 GMT Content-Disposition: inline In-Reply-To: <20141031153000.GA19229@mwanda> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dan Carpenter Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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