x86: make ZERO_PAGE() at least parse its argument [Linux 5.1]

x86: make ZERO_PAGE() at least parse its argument [Linux 5.1]

This Linux kernel change "x86: make ZERO_PAGE() at least parse its argument" is included in the Linux 5.1 release. This change is authored by Linus Torvalds <torvalds [at] linux-foundation.org> on Mon Apr 29 09:51:29 2019 -0700. The commit for this change in Linux stable tree is 8087148 (patch).

x86: make ZERO_PAGE() at least parse its argument

This doesn't really do anything, but at least we now parse teh
ZERO_PAGE() address argument so that we'll catch the most obvious errors
in usage next time they'll happen.

See commit 6a5c5d26c4c6 ("rdma: fix build errors on s390 and MIPS due to
bad ZERO_PAGE use") what happens when we don't have any use of the macro
argument at all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/x86/include/asm/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 2779ace..50b3e2d 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -46,7 +46,7 @@
 extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
-#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+#define ZERO_PAGE(vaddr) ((void)(vaddr),virt_to_page(empty_zero_page))

 extern spinlock_t pgd_lock;
 extern struct list_head pgd_list;

Leave a Reply

Your email address will not be published. Required fields are marked *