From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Justin P. Mattock" Subject: Re: [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used Date: Wed, 16 Jun 2010 10:01:23 -0700 Message-ID: <4C190363.8010900@gmail.com> References: <1276666434-11227-1-git-send-email-justinmattock@gmail.com> <1276666434-11227-4-git-send-email-justinmattock@gmail.com> <20100616060738.GA12461@host-a-229.ustcsz.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20100616060738.GA12461-XdzxFlWC3YoNXa20cRcSYJWwCtiK4VeF@public.gmane.org> Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Junchang Wang Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-scsi@vger.kernel.org On 06/15/2010 11:07 PM, Junchang Wang wrote: > On Tue, Jun 15, 2010 at 10:33:52PM -0700, Justin P. Mattock wrote: >> @@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus) >> void pci_enable_bridges(struct pci_bus *bus) >> { >> struct pci_dev *dev; >> - int retval; >> >> list_for_each_entry(dev,&bus->devices, bus_list) { >> if (dev->subordinate) { >> if (!pci_is_enabled(dev)) { >> - retval = pci_enable_device(dev); > Hi Justin, > > pci_enable_device initializes device before it's used by a driver. > > I think you should add check instead of eliminating pci_enable_device. > > For example, > retval = pci_enable_device(dev); > if (retval< 0) { > goto handle_err; > } > > --Junchang > > this gets it to compile with no warning. although not sure if correct. if (dev->subordinate) { if (!pci_is_enabled(dev)) { retval = pci_enable_device(dev); if (retval) printk("test...\n"); pci_set_master(dev); } pci_enable_bridges(dev->subordinate); } Justin P. Mattock -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html