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


Groups > linux.kernel > #1292212 > unrolled thread

[PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

Started byChen Gang <chengang@emindsoft.com.cn>
First post2015-12-15 15:20 +0100
Last post2015-12-15 21:40 +0100
Articles 8 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH trivial] include: asm-generic: Notice about 80 columns in  pgtable-no*.h Chen Gang <chengang@emindsoft.com.cn> - 2015-12-15 15:20 +0100
    Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in  pgtable-no*.h kbuild test robot <lkp@intel.com> - 2015-12-15 16:40 +0100
    Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in  pgtable-no*.h kbuild test robot <lkp@intel.com> - 2015-12-15 16:50 +0100
      Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h Arnd Bergmann <arnd@arndb.de> - 2015-12-15 17:00 +0100
        Re: [PATCH trivial] include: asm-generic: Notice about 80 columns  in pgtable-no*.h Chen Gang <chengang@emindsoft.com.cn> - 2015-12-15 23:10 +0100
    Re: [PATCH trivial] include: asm-generic: Notice about 80 columns  in pgtable-no*.h Joe Perches <joe@perches.com> - 2015-12-15 21:30 +0100
      Re: [PATCH trivial] include: asm-generic: Notice about 80 columns  in pgtable-no*.h Chen Gang <chengang@emindsoft.com.cn> - 2015-12-15 23:10 +0100
    Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in  pgtable-no*.h kbuild test robot <lkp@intel.com> - 2015-12-15 21:40 +0100

#1292212 — [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

FromChen Gang <chengang@emindsoft.com.cn>
Date2015-12-15 15:20 +0100
Subject[PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
Message-ID<qFYCm-5bR-19@gated-at.bofh.it>
It is a trivial patch.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 include/asm-generic/pgtable-nopmd.h | 3 ++-
 include/asm-generic/pgtable-nopud.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
index 725612b..7a81185 100644
--- a/include/asm-generic/pgtable-nopmd.h
+++ b/include/asm-generic/pgtable-nopmd.h
@@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud)	{ }
  * (pmds are folded into puds so this doesn't get actually called,
  * but the define is needed for a generic inline function.)
  */
-#define set_pud(pudptr, pudval)			set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
+#define set_pud(pudptr, pudval)			(set_pmd((pmd_t *)(pudptr), \
+							(pmd_t) { pudval }))
 
 static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
 {
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
index 810431d..bc78818 100644
--- a/include/asm-generic/pgtable-nopud.h
+++ b/include/asm-generic/pgtable-nopud.h
@@ -33,7 +33,8 @@ static inline void pgd_clear(pgd_t *pgd)	{ }
  * (puds are folded into pgds so this doesn't get actually called,
  * but the define is needed for a generic inline function.)
  */
-#define set_pgd(pgdptr, pgdval)			set_pud((pud_t *)(pgdptr), (pud_t) { pgdval })
+#define set_pgd(pgdptr, pgdval)			(set_pud((pud_t *)(pgdptr), \
+							(pud_t) { pgdval }))
 
 static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
 {
-- 
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]


#1292275

Fromkbuild test robot <lkp@intel.com>
Date2015-12-15 16:40 +0100
Message-ID<qFZRM-64B-11@gated-at.bofh.it>
In reply to#1292212

[Multipart message — attachments visible in raw view] — view raw

Hi Chen,

[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]

url:    https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: mips-xway_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/mm.h:55:0,
                    from include/linux/pid_namespace.h:6,
                    from include/linux/ptrace.h:8,
                    from arch/mips/mm/fault.c:16:
   arch/mips/mm/fault.c: In function '__do_page_fault':
>> arch/mips/include/asm/pgtable.h:241:33: error: expected expression before 'do'
    #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
                                    ^
>> include/asm-generic/pgtable-nopmd.h:41:36: note: in expansion of macro 'set_pmd'
    #define set_pud(pudptr, pudval)   (set_pmd((pmd_t *)(pudptr), \
                                       ^
>> include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
    #define set_pgd(pgdptr, pgdval)   (set_pud((pud_t *)(pgdptr), \
                                       ^
>> arch/mips/mm/fault.c:314:3: note: in expansion of macro 'set_pgd'
      set_pgd(pgd, *pgd_k);
      ^

vim +/set_pmd +41 include/asm-generic/pgtable-nopmd.h

    25	 * The "pud_xxx()" functions here are trivial for a folded two-level
    26	 * setup: the pmd is never bad, and a pmd always exists (as it's folded
    27	 * into the pud entry)
    28	 */
    29	static inline int pud_none(pud_t pud)		{ return 0; }
    30	static inline int pud_bad(pud_t pud)		{ return 0; }
    31	static inline int pud_present(pud_t pud)	{ return 1; }
    32	static inline void pud_clear(pud_t *pud)	{ }
    33	#define pmd_ERROR(pmd)				(pud_ERROR((pmd).pud))
    34	
    35	#define pud_populate(mm, pmd, pte)		do { } while (0)
    36	
    37	/*
    38	 * (pmds are folded into puds so this doesn't get actually called,
    39	 * but the define is needed for a generic inline function.)
    40	 */
  > 41	#define set_pud(pudptr, pudval)			(set_pmd((pmd_t *)(pudptr), \
    42								(pmd_t) { pudval }))
    43	
    44	static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
    45	{
    46		return (pmd_t *)pud;
    47	}
    48	
    49	#define pmd_val(x)				(pud_val((x).pud))

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1292297

Fromkbuild test robot <lkp@intel.com>
Date2015-12-15 16:50 +0100
Message-ID<qG01s-68o-35@gated-at.bofh.it>
In reply to#1292212

[Multipart message — attachments visible in raw view] — view raw

Hi Chen,

[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]

url:    https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: arm-shannon_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All error/warnings (new ones prefixed by >>):

   In file included from arch/arm/include/asm/pgtable.h:33:0,
                    from include/linux/mm.h:55,
                    from arch/arm/mm/fault.c:13:
   arch/arm/mm/fault.c: In function 'do_translation_fault':
>> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
    #define set_pud(pud,pudp) do { } while (0)
                              ^
   include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
    #define set_pgd(pgdptr, pgdval)   (set_pud((pud_t *)(pgdptr), \
                                       ^
>> arch/arm/mm/fault.c:444:3: note: in expansion of macro 'set_pgd'
      set_pgd(pgd, *pgd_k);
      ^

vim +/set_pgd +444 arch/arm/mm/fault.c

^1da177e Linus Torvalds 2005-04-16  428  	pmd_t *pmd, *pmd_k;
^1da177e Linus Torvalds 2005-04-16  429  
^1da177e Linus Torvalds 2005-04-16  430  	if (addr < TASK_SIZE)
^1da177e Linus Torvalds 2005-04-16  431  		return do_page_fault(addr, fsr, regs);
^1da177e Linus Torvalds 2005-04-16  432  
5e27fb78 Anfei          2010-06-08  433  	if (user_mode(regs))
5e27fb78 Anfei          2010-06-08  434  		goto bad_area;
5e27fb78 Anfei          2010-06-08  435  
^1da177e Linus Torvalds 2005-04-16  436  	index = pgd_index(addr);
^1da177e Linus Torvalds 2005-04-16  437  
^1da177e Linus Torvalds 2005-04-16  438  	pgd = cpu_get_pgd() + index;
^1da177e Linus Torvalds 2005-04-16  439  	pgd_k = init_mm.pgd + index;
^1da177e Linus Torvalds 2005-04-16  440  
^1da177e Linus Torvalds 2005-04-16  441  	if (pgd_none(*pgd_k))
^1da177e Linus Torvalds 2005-04-16  442  		goto bad_area;
^1da177e Linus Torvalds 2005-04-16  443  	if (!pgd_present(*pgd))
^1da177e Linus Torvalds 2005-04-16 @444  		set_pgd(pgd, *pgd_k);
^1da177e Linus Torvalds 2005-04-16  445  
516295e5 Russell King   2010-11-21  446  	pud = pud_offset(pgd, addr);
516295e5 Russell King   2010-11-21  447  	pud_k = pud_offset(pgd_k, addr);
516295e5 Russell King   2010-11-21  448  
516295e5 Russell King   2010-11-21  449  	if (pud_none(*pud_k))
516295e5 Russell King   2010-11-21  450  		goto bad_area;
516295e5 Russell King   2010-11-21  451  	if (!pud_present(*pud))
516295e5 Russell King   2010-11-21  452  		set_pud(pud, *pud_k);

:::::: The code at line 444 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1292307 — Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-15 17:00 +0100
SubjectRe: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
Message-ID<qG0b9-6bS-41@gated-at.bofh.it>
In reply to#1292297
On Tuesday 15 December 2015 23:47:28 kbuild test robot wrote:
>                     from include/linux/mm.h:55,
>                     from arch/arm/mm/fault.c:13:
>    arch/arm/mm/fault.c: In function 'do_translation_fault':
> >> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
>     #define set_pud(pud,pudp) do { } while (0)
>                               ^
>    include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
>     #define set_pgd(pgdptr, pgdval)   (set_pud((pud_t *)(pgdptr), \
> 

This is a result of the added braces, please redo the patch.

	Arnd
--
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] | [next] | [standalone]


#1292592 — Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

FromChen Gang <chengang@emindsoft.com.cn>
Date2015-12-15 23:10 +0100
SubjectRe: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
Message-ID<qG5Xc-1EX-29@gated-at.bofh.it>
In reply to#1292307
On 12/15/15 23:50, Arnd Bergmann wrote:
> On Tuesday 15 December 2015 23:47:28 kbuild test robot wrote:
>>                     from include/linux/mm.h:55,
>>                     from arch/arm/mm/fault.c:13:
>>    arch/arm/mm/fault.c: In function 'do_translation_fault':
>>>> arch/arm/include/asm/pgtable-2level.h:187:27: error: expected expression before 'do'
>>     #define set_pud(pud,pudp) do { } while (0)
>>                               ^
>>    include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
>>     #define set_pgd(pgdptr, pgdval)   (set_pud((pud_t *)(pgdptr), \
>>
> 
> This is a result of the added braces, please redo the patch.
> 

OK, thanks.

-- 
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] | [next] | [standalone]


#1292518 — Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

FromJoe Perches <joe@perches.com>
Date2015-12-15 21:30 +0100
SubjectRe: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
Message-ID<qG4oq-Bj-9@gated-at.bofh.it>
In reply to#1292212
On Tue, 2015-12-15 at 22:15 +0800, Chen Gang wrote:
> It is a trivial patch.
[]
> diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
[]
> @@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud)	{ }
>   * (pmds are folded into puds so this doesn't get actually called,
>   * but the define is needed for a generic inline function.)
>   */
> -#define set_pud(pudptr, pudval)			set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
> +#define set_pud(pudptr, pudval)			(set_pmd((pmd_t *)(pudptr), \
> +							(pmd_t) { pudval }))

Not quite so trivial.

If you _really_ want to break this up for 80 columns,
and I don't think it's necessary, it might be better
to use something like:

#define set_pud(pudptr, pudval)					\
	set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })

--
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] | [next] | [standalone]


#1292591 — Re: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h

FromChen Gang <chengang@emindsoft.com.cn>
Date2015-12-15 23:10 +0100
SubjectRe: [PATCH trivial] include: asm-generic: Notice about 80 columns in pgtable-no*.h
Message-ID<qG5Xc-1EX-31@gated-at.bofh.it>
In reply to#1292518
On 12/16/15 04:26, Joe Perches wrote:
> On Tue, 2015-12-15 at 22:15 +0800, Chen Gang wrote:
>> It is a trivial patch.
> []
>> diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
> []
>> @@ -38,7 +38,8 @@ static inline void pud_clear(pud_t *pud)	{ }
>>   * (pmds are folded into puds so this doesn't get actually called,
>>   * but the define is needed for a generic inline function.)
>>   */
>> -#define set_pud(pudptr, pudval)			set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
>> +#define set_pud(pudptr, pudval)			(set_pmd((pmd_t *)(pudptr), \
>> +							(pmd_t) { pudval }))
> 
> Not quite so trivial.
> 
> If you _really_ want to break this up for 80 columns,
> and I don't think it's necessary, it might be better
> to use something like:
> 
> #define set_pud(pudptr, pudval)					\
> 	set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
>

OK, thanks. For me, it is better. 

-- 
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] | [next] | [standalone]


#1292522

Fromkbuild test robot <lkp@intel.com>
Date2015-12-15 21:40 +0100
Message-ID<qG4y6-FM-5@gated-at.bofh.it>
In reply to#1292212

[Multipart message — attachments visible in raw view] — view raw

Hi Chen,

[auto build test ERROR on v4.4-rc5]
[also build test ERROR on next-20151215]

url:    https://github.com/0day-ci/linux/commits/Chen-Gang/include-asm-generic-Notice-about-80-columns-in-pgtable-no-h/20151215-221607
config: arm-axm55xx_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   In file included from arch/arm/include/asm/pgtable.h:31:0,
                    from include/linux/mm.h:55,
                    from arch/arm/mm/fault.c:13:
   arch/arm/mm/fault.c: In function 'do_translation_fault':
>> arch/arm/include/asm/pgtable-3level.h:158:2: error: expected expression before 'do'
     do {    \
     ^
   include/asm-generic/pgtable-nopud.h:36:36: note: in expansion of macro 'set_pud'
    #define set_pgd(pgdptr, pgdval)   (set_pud((pud_t *)(pgdptr), \
                                       ^
   arch/arm/mm/fault.c:444:3: note: in expansion of macro 'set_pgd'
      set_pgd(pgd, *pgd_k);
      ^

vim +/do +158 arch/arm/include/asm/pgtable-3level.h

da028779 Catalin Marinas  2011-11-22  142  #define pud_none(pud)		(!pud_val(pud))
da028779 Catalin Marinas  2011-11-22  143  #define pud_bad(pud)		(!(pud_val(pud) & 2))
da028779 Catalin Marinas  2011-11-22  144  #define pud_present(pud)	(pud_val(pud))
cc577c26 Christoffer Dall 2013-01-20  145  #define pmd_table(pmd)		((pmd_val(pmd) & PMD_TYPE_MASK) == \
cc577c26 Christoffer Dall 2013-01-20  146  						 PMD_TYPE_TABLE)
cc577c26 Christoffer Dall 2013-01-20  147  #define pmd_sect(pmd)		((pmd_val(pmd) & PMD_TYPE_MASK) == \
cc577c26 Christoffer Dall 2013-01-20  148  						 PMD_TYPE_SECT)
1fd15b87 Russell King     2013-10-23  149  #define pmd_large(pmd)		pmd_sect(pmd)
da028779 Catalin Marinas  2011-11-22  150  
da028779 Catalin Marinas  2011-11-22  151  #define pud_clear(pudp)			\
da028779 Catalin Marinas  2011-11-22  152  	do {				\
da028779 Catalin Marinas  2011-11-22  153  		*pudp = __pud(0);	\
da028779 Catalin Marinas  2011-11-22  154  		clean_pmd_entry(pudp);	\
da028779 Catalin Marinas  2011-11-22  155  	} while (0)
da028779 Catalin Marinas  2011-11-22  156  
da028779 Catalin Marinas  2011-11-22  157  #define set_pud(pudp, pud)		\
da028779 Catalin Marinas  2011-11-22 @158  	do {				\
da028779 Catalin Marinas  2011-11-22  159  		*pudp = pud;		\
da028779 Catalin Marinas  2011-11-22  160  		flush_pmd_entry(pudp);	\
da028779 Catalin Marinas  2011-11-22  161  	} while (0)
da028779 Catalin Marinas  2011-11-22  162  
da028779 Catalin Marinas  2011-11-22  163  static inline pmd_t *pud_page_vaddr(pud_t pud)
da028779 Catalin Marinas  2011-11-22  164  {
da028779 Catalin Marinas  2011-11-22  165  	return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
da028779 Catalin Marinas  2011-11-22  166  }

:::::: The code at line 158 was first introduced by commit
:::::: da02877987e6e173ebba137d4e1e155e1f1151cd ARM: LPAE: Page table maintenance for the 3-level format

:::::: TO: Catalin Marinas <catalin.marinas@arm.com>
:::::: CC: Catalin Marinas <catalin.marinas@arm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web