All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pan Bian <bianpan2016@163.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <groeck@chromium.org>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	Thierry Escande <thierry.escande@collabora.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Wei-Ning Huang <wnhuang@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [V3] firmware: vpd: use memunmap instead of iounmap
Date: Thu, 10 Aug 2017 17:45:49 -0700	[thread overview]
Message-ID: <20170811004549.GA13947@dtor-ws> (raw)
In-Reply-To: <1502406793-26329-1-git-send-email-bianpan2016@163.com>

On Fri, Aug 11, 2017 at 07:13:13AM +0800, Pan Bian wrote:
> In functions vpd_sections_init() and vpd_section_init(), iounmap() is
> used to unmap memory. However, in these cases, memunmap() should be
> used.
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
> V2: change error label err_iounmap to err_memunmap
> V3: add changes from V1 to V2
> ---
>  drivers/firmware/google/vpd.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c
> index 7894572..35e553b 100644
> --- a/drivers/firmware/google/vpd.c
> +++ b/drivers/firmware/google/vpd.c
> @@ -202,7 +202,7 @@ static int vpd_section_init(const char *name, struct vpd_section *sec,
>  	sec->raw_name = kasprintf(GFP_KERNEL, "%s_raw", name);
>  	if (!sec->raw_name) {
>  		err = -ENOMEM;
> -		goto err_iounmap;
> +		goto err_memunmap;
>  	}
>  
>  	sysfs_bin_attr_init(&sec->bin_attr);
> @@ -233,8 +233,8 @@ static int vpd_section_init(const char *name, struct vpd_section *sec,
>  	sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
>  err_free_raw_name:
>  	kfree(sec->raw_name);
> -err_iounmap:
> -	iounmap(sec->baseaddr);
> +err_memunmap:
> +	memunmap(sec->baseaddr);
>  	return err;
>  }
>  
> @@ -245,7 +245,7 @@ static int vpd_section_destroy(struct vpd_section *sec)
>  		kobject_put(sec->kobj);
>  		sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
>  		kfree(sec->raw_name);
> -		iounmap(sec->baseaddr);
> +		memunmap(sec->baseaddr);
>  	}
>  
>  	return 0;
> @@ -262,7 +262,7 @@ static int vpd_sections_init(phys_addr_t physaddr)
>  		return -ENOMEM;
>  
>  	memcpy_fromio(&header, temp, sizeof(struct vpd_cbmem));
> -	iounmap(temp);
> +	memunmap(temp);
>  
>  	if (header.magic != VPD_CBMEM_MAGIC)
>  		return -ENODEV;
> -- 
> 1.9.1
> 
> 

-- 
Dmitry

      reply	other threads:[~2017-08-11  0:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 23:13 [V3] firmware: vpd: use memunmap instead of iounmap Pan Bian
2017-08-11  0:45 ` Dmitry Torokhov [this message]

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=20170811004549.GA13947@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bianpan2016@163.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.escande@collabora.com \
    --cc=weiyongjun1@huawei.com \
    --cc=wnhuang@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.