linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: fix tpm_acpi sparse warning on different address spaces
@ 2012-08-30 14:38 Kent Yoder
  2012-08-30 17:45 ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Kent Yoder @ 2012-08-30 14:38 UTC (permalink / raw)
  To: James Morris
  Cc: linux-kernel, linux-security-module, tpmdd-devel,
	kernel-janitors, Fengguang Wu

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>
---
 drivers/char/tpm/tpm_acpi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_acpi.c b/drivers/char/tpm/tpm_acpi.c
index fe3fa94..36bdcfa 100644
--- a/drivers/char/tpm/tpm_acpi.c
+++ b/drivers/char/tpm/tpm_acpi.c
@@ -49,7 +49,7 @@ int read_log(struct tpm_bios_log *log)
 {
 	struct acpi_tcpa *buff;
 	acpi_status status;
-	struct acpi_table_header *virt;
+	void __iomem *virt;
 	u64 len, start;
 
 	if (log->bios_event_log != NULL) {
@@ -102,7 +102,7 @@ int read_log(struct tpm_bios_log *log)
 		return -EIO;
 	}
 
-	memcpy(log->bios_event_log, virt, len);
+	memcpy(log->bios_event_log, (void *)virt, len);
 
 	acpi_os_unmap_memory(virt, len);
 	return 0;
-- 
1.7.5.4


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

end of thread, other threads:[~2012-09-12  3:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 14:38 [PATCH] tpm: fix tpm_acpi sparse warning on different address spaces Kent Yoder
2012-08-30 17:45 ` Dan Carpenter
2012-08-30 19:21   ` Kent Yoder
2012-09-02 16:30     ` Dan Carpenter
2012-09-04 16:13       ` Kent Yoder
2012-09-04 16:18       ` Kent Yoder
2012-09-12  3:12         ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).