tsnep: Fix resource_size cocci warning
authorGerhard Engleder <gerhard@engleder-embedded.com>
Wed, 24 Nov 2021 20:52:25 +0000 (21:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Nov 2021 01:09:13 +0000 (17:09 -0800)
The following warning is fixed, by removing the unused resource size:

drivers/net/ethernet/engleder/tsnep_main.c:1155:21-24:
WARNING: Suspicious code. resource_size is maybe missing with io

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://lore.kernel.org/r/20211124205225.13985-1-gerhard@engleder-embedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/engleder/tsnep.h
drivers/net/ethernet/engleder/tsnep_main.c

index d19fa17..23bbece 100644 (file)
@@ -125,7 +125,6 @@ struct tsnep_adapter {
        struct platform_device *pdev;
        struct device *dmadev;
        void __iomem *addr;
-       unsigned long size;
        int irq;
 
        bool gate_control;
index 03d5b31..955565a 100644 (file)
@@ -1152,7 +1152,6 @@ static int tsnep_probe(struct platform_device *pdev)
        adapter->addr = devm_ioremap_resource(&pdev->dev, io);
        if (IS_ERR(adapter->addr))
                return PTR_ERR(adapter->addr);
-       adapter->size = io->end - io->start + 1;
        adapter->irq = platform_get_irq(pdev, 0);
        netdev->mem_start = io->start;
        netdev->mem_end = io->end;