lkml.org 
[lkml]   [2012]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tpm: fix tpm_acpi sparse warning on different address spaces
On Thu, Aug 30, 2012 at 10:45:56AM -0700, Dan Carpenter wrote:
> On Thu, Aug 30, 2012 at 09:38:41AM -0500, Kent Yoder wrote:
> > acpi_os_map_memory expects its return value to be in the __iomem address
> > space. Cast it back later when used in a memcpy to avoid the same sparse
> > warning there.
> >
> > Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
>
> I can't download linux-next right now but I don't think this is the
> correct fix. I don't think you can memcpy() directly from __iomem.
> The static checker is warning about a valid bug which should be
> addressed instead of just casted away and silenced.

I took a look at other uses of the return from acpi_os_map_memory(),
such as acpi_tb_parse_fadt(), which passes the returned pointer to
acpi_tb_create_local_fadt(), which uses ACPI_MEMCPY on it, which is just
memcpy. This code lives in drivers/acpi.

Kent

>
> regards,
> dan carpenter
>
>



\
 
 \ /
  Last update: 2012-08-30 22:01    [W:0.067 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site