Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: akiyano@amazon.com
Cc: netdev@vger.kernel.org, dwmw@amazon.com, zorik@amazon.com,
	matua@amazon.com, saeedb@amazon.com, msw@amazon.com,
	aliguori@amazon.com, nafea@amazon.com, gtzalik@amazon.com,
	netanel@amazon.com, alisaidi@amazon.com
Subject: Re: [PATCH V1 net 2/5] net: ena: fix warning in rmmod caused by double iounmap
Date: Mon, 08 Oct 2018 10:56:53 -0700 (PDT)	[thread overview]
Message-ID: <20181008.105653.2116602743772544221.davem@davemloft.net> (raw)
In-Reply-To: <1539001724-25980-3-git-send-email-akiyano@amazon.com>

From: <akiyano@amazon.com>
Date: Mon, 8 Oct 2018 15:28:41 +0300

> From: Arthur Kiyanovski <akiyano@amazon.com>
> 
> Memory mapped with devm_ioremap is automatically freed when the driver
> is disconnected from the device. Therefore there is no need to
> explicitly call devm_iounmap.
> 
> Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index 25621a2..23f2dda 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -3099,15 +3099,7 @@ static int ena_rss_init_default(struct ena_adapter *adapter)
>  
>  static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev)
>  {
> -	int release_bars;
> -
> -	if (ena_dev->mem_bar)
> -		devm_iounmap(&pdev->dev, ena_dev->mem_bar);
> -
> -	if (ena_dev->reg_bar)
> -		devm_iounmap(&pdev->dev, ena_dev->reg_bar);
> -
> -	release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
> +	int release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
>  	pci_release_selected_regions(pdev, release_bars);

Always have an empty line between local variable declarations and actual
function code.

  reply	other threads:[~2018-10-09  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 12:28 [PATCH V1 net 0/5] minor bug fixes for ENA Ethernet driver akiyano
2018-10-08 12:28 ` [PATCH V1 net 1/5] net: ena: fix indentations in ena_defs for better readability akiyano
2018-10-08 12:28 ` [PATCH V1 net 2/5] net: ena: fix warning in rmmod caused by double iounmap akiyano
2018-10-08 17:56   ` David Miller [this message]
2018-10-08 12:28 ` [PATCH V1 net 3/5] net: ena: fix rare bug when failed restart/resume is followed by driver removal akiyano
2018-10-08 12:28 ` [PATCH V1 net 4/5] net: ena: fix NULL dereference due to untimely napi initialization akiyano
2018-10-08 12:28 ` [PATCH V1 net 5/5] net: ena: fix auto casting to boolean akiyano
2018-10-08 12:47 ` [PATCH V1 net 0/5] minor bug fixes for ENA Ethernet driver Bshara, Nafea
2018-10-08 14:38   ` Machulsky, Zorik
2018-10-08 14:42   ` Machulsky, Zorik
2018-10-08 18:01   ` David Miller
2018-10-08 17:56 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181008.105653.2116602743772544221.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akiyano@amazon.com \
    --cc=aliguori@amazon.com \
    --cc=alisaidi@amazon.com \
    --cc=dwmw@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=msw@amazon.com \
    --cc=nafea@amazon.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedb@amazon.com \
    --cc=zorik@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox