Skip to content

Commit

Permalink
PCI: Remove unnecessary initializations
Browse files Browse the repository at this point in the history
We always assign "fields" immediately, so remove the unnecessary
initializations.  No functional change intended.

Link: https://lore.kernel.org/r/20230824193712.542167-4-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  • Loading branch information
Bjorn Helgaas committed Aug 25, 2023
1 parent ecfea5d commit a49287d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,
u32 vendor, device, subvendor = PCI_ANY_ID,
subdevice = PCI_ANY_ID, class = 0, class_mask = 0;
unsigned long driver_data = 0;
int fields = 0;
int fields;
int retval = 0;

fields = sscanf(buf, "%x %x %x %x %x %x %lx",
Expand Down Expand Up @@ -260,7 +260,7 @@ static ssize_t remove_id_store(struct device_driver *driver, const char *buf,
struct pci_driver *pdrv = to_pci_driver(driver);
u32 vendor, device, subvendor = PCI_ANY_ID,
subdevice = PCI_ANY_ID, class = 0, class_mask = 0;
int fields = 0;
int fields;
size_t retval = -ENODEV;

fields = sscanf(buf, "%x %x %x %x %x %x",
Expand Down

0 comments on commit a49287d

Please sign in to comment.