1
0
Fork 0

sparc/iommu: use !PageHighMem to check if a page has a kernel mapping

This deobsfucates the check a bit, and prepares for future changes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.2
Christoph Hellwig 2019-04-16 20:23:39 +02:00 committed by David S. Miller
parent 269fe56551
commit 031abf0b70
1 changed files with 2 additions and 1 deletions

View File

@ -273,7 +273,8 @@ static int sbus_iommu_map_sg_pflush(struct device *dev, struct scatterlist *sgl,
* XXX Is this a good assumption?
* XXX What if someone else unmaps it here and races us?
*/
if ((page = (unsigned long) page_address(sg_page(sg))) != 0) {
if (!PageHighMem(sg_page(sg))) {
page = (unsigned long)page_address(sg_page(sg));
for (i = 0; i < n; i++) {
if (page != oldpage) { /* Already flushed? */
flush_page_for_dma(page);