All of lore.kernel.org
 help / color / mirror / Atom feed
* Note about acpi_get_table_header
@ 2020-02-04  9:17 Jean Delvare
  2020-02-04 10:05 ` Hanjun Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2020-02-04  9:17 UTC (permalink / raw)
  To: linux-acpi; +Cc: Robert Moore, Erik Kaneda, Rafael J. Wysocki

Hello,

The description block before acpi_get_table_header() in
drivers/acpi/acpica/tbxface.c includes the following comment:

 * NOTE:        Caller is responsible in unmapping the header with
 *              acpi_os_unmap_memory

However, looking at the code, it seems that we are already calling
acpi_os_unmap_memory() internally as appropriate, and we always return
a copy of the header, not a pointer to it. So I see no reason why the
caller would ever need to call acpi_os_unmap_memory(). As a matter of
fact the only current caller of this function does NOT call
acpi_os_unmap_memory() afterwards.

So I believe this note is wrong and should be removed?

Thanks,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Note about acpi_get_table_header
  2020-02-04  9:17 Note about acpi_get_table_header Jean Delvare
@ 2020-02-04 10:05 ` Hanjun Guo
  2020-02-04 20:26   ` Moore, Robert
  0 siblings, 1 reply; 3+ messages in thread
From: Hanjun Guo @ 2020-02-04 10:05 UTC (permalink / raw)
  To: Jean Delvare, linux-acpi; +Cc: Robert Moore, Erik Kaneda, Rafael J. Wysocki

On 2020/2/4 17:17, Jean Delvare wrote:
> Hello,
> 
> The description block before acpi_get_table_header() in
> drivers/acpi/acpica/tbxface.c includes the following comment:
> 
>  * NOTE:        Caller is responsible in unmapping the header with
>  *              acpi_os_unmap_memory

I'm confused as well when I was reading the code.

> 
> However, looking at the code, it seems that we are already calling
> acpi_os_unmap_memory() internally as appropriate, and we always return
> a copy of the header, not a pointer to it. So I see no reason why the
> caller would ever need to call acpi_os_unmap_memory(). As a matter of
> fact the only current caller of this function does NOT call
> acpi_os_unmap_memory() afterwards.
> 
> So I believe this note is wrong and should be removed?

I think so.

Thanks
Hanjun



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Note about acpi_get_table_header
  2020-02-04 10:05 ` Hanjun Guo
@ 2020-02-04 20:26   ` Moore, Robert
  0 siblings, 0 replies; 3+ messages in thread
From: Moore, Robert @ 2020-02-04 20:26 UTC (permalink / raw)
  To: Hanjun Guo, Jean Delvare, linux-acpi@vger.kernel.org
  Cc: Kaneda, Erik, Wysocki, Rafael J



-----Original Message-----
From: Hanjun Guo <guohanjun@huawei.com> 
Sent: Tuesday, February 04, 2020 2:05 AM
To: Jean Delvare <jdelvare@suse.de>; linux-acpi@vger.kernel.org
Cc: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>
Subject: Re: Note about acpi_get_table_header

On 2020/2/4 17:17, Jean Delvare wrote:
> Hello,
> 
> The description block before acpi_get_table_header() in 
> drivers/acpi/acpica/tbxface.c includes the following comment:
> 
>  * NOTE:        Caller is responsible in unmapping the header with
>  *              acpi_os_unmap_memory

I'm confused as well when I was reading the code.

> 
> However, looking at the code, it seems that we are already calling
> acpi_os_unmap_memory() internally as appropriate, and we always return 
> a copy of the header, not a pointer to it. So I see no reason why the 
> caller would ever need to call acpi_os_unmap_memory(). As a matter of 
> fact the only current caller of this function does NOT call
> acpi_os_unmap_memory() afterwards.
> 
> So I believe this note is wrong and should be removed?

Yes, the note is obsolete. I'll remove it.

Bob

I think so.

Thanks
Hanjun



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-04 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-04  9:17 Note about acpi_get_table_header Jean Delvare
2020-02-04 10:05 ` Hanjun Guo
2020-02-04 20:26   ` Moore, Robert

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.