dolohow / uksm

Ultra Kernel Samepage Merging
241 stars 35 forks source link

Fix clang warnings again #78

Closed skbeh closed 1 year ago

skbeh commented 2 years ago

This time I tested on both gcc and clang, they can pass the build without any warnings. 0001-Fix-clang-warnings.patch.gz

From 90af43787008e3d838696d7f85879ea428a71fe1 Mon Sep 17 00:00:00 2001
From: skbeh <60107333+skbeh@users.noreply.github.com>
Date: Wed, 4 May 2022 16:04:23 +0800
Subject: [PATCH] Fix clang warnings

---
include/linux/pgtable.h | 2 +-
include/linux/uksm.h    | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 9e6f73428a91..34bd518420b9 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1139,9 +1139,9 @@ extern void untrack_pfn_moved(struct vm_area_struct *vma);
#endif

#ifdef CONFIG_UKSM
+extern unsigned long uksm_zero_pfn __read_mostly;
static inline int is_uksm_zero_pfn(unsigned long pfn)
{
-       extern unsigned long uksm_zero_pfn;
return pfn == uksm_zero_pfn;
}
#else
diff --git a/include/linux/uksm.h b/include/linux/uksm.h
index bb8651f534f2..364473fc4907 100644
--- a/include/linux/uksm.h
+++ b/include/linux/uksm.h
@@ -16,8 +16,7 @@
#include <linux/rmap.h>
#include <linux/sched.h>

-extern unsigned long zero_pfn __read_mostly;
-extern unsigned long uksm_zero_pfn __read_mostly;
+extern unsigned long zero_pfn;
extern struct page *empty_uksm_zero_page;

/* must be done before linked to mm */
--
2.36.0