Remove variables and assignments that are never used.
Found by Krzysztof using cppcheck, e.g.,
$ cppcheck --enable=all --force
uselessAssignmentPtrArg drivers/pci/proc.c:102 Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
unreadVariable drivers/pci/setup-bus.c:1528 Variable 'old_flags' is assigned a value that is never used.
Reported-by: Krzysztof WilczyĆski <kw@linux.com>
Link: https://lore.kernel.org/r/20220313192933.434746-2-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
u8 val;
pci_user_read_config_byte(dev, off, &val);
data[off - init_off] = val;
- off++;
- --size;
}
pci_config_pm_runtime_put(dev);
size -= 2;
}
- if (size) {
+ if (size)
pci_user_write_config_byte(dev, off, data[off - init_off]);
- off++;
- --size;
- }
pci_config_pm_runtime_put(dev);
unsigned char val;
pci_user_read_config_byte(dev, pos, &val);
__put_user(val, buf);
- buf++;
pos++;
- cnt--;
}
pci_config_pm_runtime_put(dev);
unsigned char val;
__get_user(val, buf);
pci_user_write_config_byte(dev, pos, val);
- buf++;
pos++;
- cnt--;
}
pci_config_pm_runtime_put(dev);
{
struct pci_dev *dev = bus->self;
struct resource *r;
- unsigned int old_flags = 0;
+ unsigned int old_flags;
struct resource *b_res;
int idx = 1;