]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
sparc/iommu: use !PageHighMem to check if a page has a kernel mapping
authorChristoph Hellwig <hch@lst.de>
Tue, 16 Apr 2019 18:23:39 +0000 (20:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 May 2019 00:11:56 +0000 (17:11 -0700)
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>
arch/sparc/mm/iommu.c

index e8d5d73ca40d640f7e83f85964ff0151dc773df8..dcdadac03fdfe3177a16761fb1a467846a059162 100644 (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);