Skip to content

Commit

Permalink
xen/pciback: remove set but not used variable 'old_state'
Browse files Browse the repository at this point in the history
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/xen/xen-pciback/conf_space_capability.c: In function pm_ctrl_write:
drivers/xen/xen-pciback/conf_space_capability.c:119:25: warning:
 variable old_state set but not used [-Wunused-but-set-variable]

It is never used so can be removed.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
  • Loading branch information
YueHaibing authored and Juergen Gross committed Jul 26, 2019
1 parent a1078e8 commit 09e088a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/xen/xen-pciback/conf_space_capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ static int pm_ctrl_write(struct pci_dev *dev, int offset, u16 new_value,
{
int err;
u16 old_value;
pci_power_t new_state, old_state;
pci_power_t new_state;

err = pci_read_config_word(dev, offset, &old_value);
if (err)
goto out;

old_state = (pci_power_t)(old_value & PCI_PM_CTRL_STATE_MASK);
new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK);

new_value &= PM_OK_BITS;
Expand Down

0 comments on commit 09e088a

Please sign in to comment.