Message ID | 20220927151406.797800-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0e9804cff18223e750f3af52a2701945bb362f55 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] ethernet: 8390: remove unnecessary check of mem | expand |
Hello: This patch was applied to netdev/net-next.git (master) by Paolo Abeni <pabeni@redhat.com>: On Tue, 27 Sep 2022 23:14:06 +0800 you wrote: > The 'mem' returned by platform_get_resource() has been checked in probe > function, so it is no need do this check in remove function. > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > drivers/net/ethernet/8390/mcf8390.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Here is the summary with links: - [net-next] ethernet: 8390: remove unnecessary check of mem https://git.kernel.org/netdev/net-next/c/0e9804cff182 You are awesome, thank you!
diff --git a/drivers/net/ethernet/8390/mcf8390.c b/drivers/net/ethernet/8390/mcf8390.c index 21047ae1bc3d..8a7918d33419 100644 --- a/drivers/net/ethernet/8390/mcf8390.c +++ b/drivers/net/ethernet/8390/mcf8390.c @@ -450,8 +450,7 @@ static int mcf8390_remove(struct platform_device *pdev) unregister_netdev(dev); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (mem) - release_mem_region(mem->start, resource_size(mem)); + release_mem_region(mem->start, resource_size(mem)); free_netdev(dev); return 0; }
The 'mem' returned by platform_get_resource() has been checked in probe function, so it is no need do this check in remove function. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/ethernet/8390/mcf8390.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)