diff mbox

PCI: remove unused struct resource *res from pci_resource_io

Message ID 1499331620-132371-1-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Shawn Lin July 6, 2017, 9 a.m. UTC
It is never used and introduces a compile warning:

drivers/pci/pci-sysfs.c: In function 'pci_resource_io':
drivers/pci/pci-sysfs.c:1214:19: warning: variable 'res' set but not
used [-Wunused-but-set-variable]

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/pci/pci-sysfs.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Bjorn Helgaas July 10, 2017, 9:11 p.m. UTC | #1
On Thu, Jul 06, 2017 at 05:00:20PM +0800, Shawn Lin wrote:
> It is never used and introduces a compile warning:
> 
> drivers/pci/pci-sysfs.c: In function 'pci_resource_io':
> drivers/pci/pci-sysfs.c:1214:19: warning: variable 'res' set but not
> used [-Wunused-but-set-variable]
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Applied to pci/trivial for v4.14, thanks!

> ---
> 
>  drivers/pci/pci-sysfs.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index 2f3780b..0e43705 100644
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -1211,11 +1211,8 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
>  {
>  	struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
>  	int bar = (unsigned long)attr->private;
> -	struct resource *res;
>  	unsigned long port = off;
>  
> -	res = &pdev->resource[bar];
> -
>  	port += pci_resource_start(pdev, bar);
>  
>  	if (port > pci_resource_end(pdev, bar))
> -- 
> 1.9.1
> 
>
diff mbox

Patch

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 2f3780b..0e43705 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1211,11 +1211,8 @@  static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
 {
 	struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
 	int bar = (unsigned long)attr->private;
-	struct resource *res;
 	unsigned long port = off;
 
-	res = &pdev->resource[bar];
-
 	port += pci_resource_start(pdev, bar);
 
 	if (port > pci_resource_end(pdev, bar))