* [PATCH] xen/pciback: remove set but not used variable 'old_state'
@ 2019-07-24 14:08 YueHaibing
2019-07-24 23:17 ` Boris Ostrovsky
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-07-24 14:08 UTC (permalink / raw)
To: boris.ostrovsky, jgross, sstabellini; +Cc: linux-kernel, xen-devel, YueHaibing
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>
---
drivers/xen/xen-pciback/conf_space_capability.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/xen/xen-pciback/conf_space_capability.c b/drivers/xen/xen-pciback/conf_space_capability.c
index 73427d8..e569413 100644
--- a/drivers/xen/xen-pciback/conf_space_capability.c
+++ b/drivers/xen/xen-pciback/conf_space_capability.c
@@ -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;
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xen/pciback: remove set but not used variable 'old_state'
2019-07-24 14:08 [PATCH] xen/pciback: remove set but not used variable 'old_state' YueHaibing
@ 2019-07-24 23:17 ` Boris Ostrovsky
0 siblings, 0 replies; 2+ messages in thread
From: Boris Ostrovsky @ 2019-07-24 23:17 UTC (permalink / raw)
To: YueHaibing, jgross, sstabellini; +Cc: linux-kernel, xen-devel
On 7/24/19 10:08 AM, YueHaibing wrote:
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-24 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 14:08 [PATCH] xen/pciback: remove set but not used variable 'old_state' YueHaibing
2019-07-24 23:17 ` Boris Ostrovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome