Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1290585 > unrolled thread

[PATCH trivial] include/asm-generic/pgtable.h: Notice about coding styles

Started byChen Gang <chengang@emindsoft.com.cn>
First post2015-12-13 10:10 +0100
Last post2015-12-13 10:20 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH trivial] include/asm-generic/pgtable.h: Notice about coding  styles Chen Gang <chengang@emindsoft.com.cn> - 2015-12-13 10:10 +0100
    Re: [PATCH trivial] include/asm-generic/pgtable.h: Notice about coding  styles Chen Gang <chengang@emindsoft.com.cn> - 2015-12-13 10:20 +0100

#1290585 — [PATCH trivial] include/asm-generic/pgtable.h: Notice about coding styles

FromChen Gang <chengang@emindsoft.com.cn>
Date2015-12-13 10:10 +0100
Subject[PATCH trivial] include/asm-generic/pgtable.h: Notice about coding styles
Message-ID<qFaPf-6oH-1@gated-at.bofh.it>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1290590

FromChen Gang <chengang@emindsoft.com.cn>
Date2015-12-13 10:20 +0100
Message-ID<qFaYV-6rZ-9@gated-at.bofh.it>
In reply to#1290585
Hello all:

After communicated with my company, I am permitted to use my company
email to send patches to open source community.

My company supports what I have done for open source community, but at
present, I still use my personal mail id as Signed-of-by (make and send
patches mainly during my free time).

And thank my company for the support. 


Thanks.

On 12/13/15 17:08, Chen Gang wrote:
> 
> 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
> 

-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web