[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] xen/pciback: Drop two backends, squash and cleanup some code.
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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |