linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scatterlist: add a warning if sg_virt() is used on highmem pages
@ 2012-12-05 11:28 Sebastian Andrzej Siewior
  2012-12-05 21:46 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-12-05 11:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sebastian Andrzej Siewior

sg_virt() on highmem pages won't work. This WARN_ON() should catch some
that still try.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/scatterlist.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4bd6c06..4d4adab 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -198,6 +198,9 @@ static inline dma_addr_t sg_phys(struct scatterlist *sg)
  **/
 static inline void *sg_virt(struct scatterlist *sg)
 {
+#ifdef CONFIG_DEBUG_SG
+	WARN_ON(PageHighMem(sg_page(sg)));
+#endif
 	return page_address(sg_page(sg)) + sg->offset;
 }
 
-- 
1.7.10.4


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

end of thread, other threads:[~2012-12-06  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-05 11:28 [PATCH] scatterlist: add a warning if sg_virt() is used on highmem pages Sebastian Andrzej Siewior
2012-12-05 21:46 ` Andrew Morton
2012-12-06  8:47   ` Sebastian Andrzej Siewior

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).