From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: xen/pciback: Drop two backends, squash and cleanup some code. Date: Fri, 31 Oct 2014 18:30:01 +0300 Message-ID: <20141031153000.GA19229@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XkE9a-0004Ne-Hb for xen-devel@lists.xenproject.org; Fri, 31 Oct 2014 15:30:18 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s9VFUDlV017584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 31 Oct 2014 15:30:14 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9VFUCc6006464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 31 Oct 2014 15:30:13 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s9VFUCXw014106 for ; Fri, 31 Oct 2014 15:30:12 GMT Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: konrad.wilk@oracle.com Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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