From: Chen Gang <chengang@emindsoft.com.cn>
To: arnd@arndb.de, trivial@kernel.org
Cc: Linux-Arch <linux-arch@vger.kernel.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Chen Gang <gang.chen.5i5j@gmail.com>,
chenwei@emindsoft.com.cn
Subject: [PATCH trivial] include/asm-generic/pgtable.h: Notice about coding styles
Date: Sun, 13 Dec 2015 17:08:14 +0800 [thread overview]
Message-ID: <566D357E.3030004@emindsoft.com.cn> (raw)
Notice about 80 columns, and function parameters alignment.
Export zero_pfn only once.
Remove pte variable in ptep_get_and_clear_full().
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
include/asm-generic/pgtable.h | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 63abda1..aecf0141 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -135,8 +135,8 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
#ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR_FULL
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
static inline pmd_t pmdp_huge_get_and_clear_full(struct mm_struct *mm,
- unsigned long address, pmd_t *pmdp,
- int full)
+ unsigned long address,
+ pmd_t *pmdp, int full)
{
return pmdp_huge_get_and_clear(mm, address, pmdp);
}
@@ -148,9 +148,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
unsigned long address, pte_t *ptep,
int full)
{
- pte_t pte;
- pte = ptep_get_and_clear(mm, address, ptep);
- return pte;
+ return ptep_get_and_clear(mm, address, ptep);
}
#endif
@@ -183,7 +181,8 @@ extern pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
struct mm_struct;
-static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
+static inline void ptep_set_wrprotect(struct mm_struct *mm,
+ unsigned long address, pte_t *ptep)
{
pte_t old_pte = *ptep;
set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
@@ -583,10 +582,11 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
unsigned long size);
#endif
+extern unsigned long zero_pfn;
+
#ifdef __HAVE_COLOR_ZERO_PAGE
static inline int is_zero_pfn(unsigned long pfn)
{
- extern unsigned long zero_pfn;
unsigned long offset_from_zero_pfn = pfn - zero_pfn;
return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
}
@@ -596,13 +596,11 @@ static inline int is_zero_pfn(unsigned long pfn)
#else
static inline int is_zero_pfn(unsigned long pfn)
{
- extern unsigned long zero_pfn;
return pfn == zero_pfn;
}
static inline unsigned long my_zero_pfn(unsigned long addr)
{
- extern unsigned long zero_pfn;
return zero_pfn;
}
#endif
--
1.9.3
next reply other threads:[~2015-12-13 9:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-13 9:08 Chen Gang [this message]
2015-12-13 9:14 ` [PATCH trivial] include/asm-generic/pgtable.h: Notice about coding styles Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566D357E.3030004@emindsoft.com.cn \
--to=chengang@emindsoft.com.cn \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=chenwei@emindsoft.com.cn \
--cc=gang.chen.5i5j@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox