Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: Get rid of some #ifdefery in arch/mips/mm/tlb-r4k.c
@ 2011-11-18 21:30 David Daney
  2011-11-21 10:31 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2011-11-18 21:30 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: David Daney

From: David Daney <david.daney@cavium.com>

In the case of !CONFIG_HUGETLB_PAGE, in linux/hugetlb.h we have this
definition:

The other huge page constants in the if(pmd_huge()) block are likewise
defined, so we can get rid of the #ifdef CONFIG_HUGETLB_PAGE an let
the compiler optimize this block away instead.  Doing this the code
has a much cleaner appearance.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/mm/tlb-r4k.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 88dc49c..f93af98 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -305,7 +305,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
 	pudp = pud_offset(pgdp, address);
 	pmdp = pmd_offset(pudp, address);
 	idx = read_c0_index();
-#ifdef CONFIG_HUGETLB_PAGE
+
 	/* this could be a huge page  */
 	if (pmd_huge(*pmdp)) {
 		unsigned long lo;
@@ -321,9 +321,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
 		else
 			tlb_write_indexed();
 		write_c0_pagemask(PM_DEFAULT_MASK);
-	} else
-#endif
-	{
+	} else {
 		ptep = pte_offset_map(pmdp, address);
 
 #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Get rid of some #ifdefery in arch/mips/mm/tlb-r4k.c
  2011-11-18 21:30 [PATCH] MIPS: Get rid of some #ifdefery in arch/mips/mm/tlb-r4k.c David Daney
@ 2011-11-21 10:31 ` Sergei Shtylyov
  2011-11-21 18:16   ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2011-11-21 10:31 UTC (permalink / raw)
  To: David Daney; +Cc: linux-mips, ralf, David Daney

Hello.

On 19-11-2011 1:30, David Daney wrote:

> From: David Daney<david.daney@cavium.com>

> In the case of !CONFIG_HUGETLB_PAGE, in linux/hugetlb.h we have this
> definition:

    Missed it?

> The other huge page constants in the if(pmd_huge()) block are likewise
> defined, so we can get rid of the #ifdef CONFIG_HUGETLB_PAGE an let
> the compiler optimize this block away instead.  Doing this the code
> has a much cleaner appearance.

> Signed-off-by: David Daney <david.daney@cavium.com>

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Get rid of some #ifdefery in arch/mips/mm/tlb-r4k.c
  2011-11-21 10:31 ` Sergei Shtylyov
@ 2011-11-21 18:16   ` David Daney
  0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2011-11-21 18:16 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: David Daney, linux-mips@linux-mips.org, ralf@linux-mips.org,
	David Daney

On 11/21/2011 02:31 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 19-11-2011 1:30, David Daney wrote:
>
>> From: David Daney<david.daney@cavium.com>
>
>> In the case of !CONFIG_HUGETLB_PAGE, in linux/hugetlb.h we have this
>> definition:
>
>      Missed it?

Indeed, I could swear that I put '#define pmd_huge(x)	0' in that commit 
log, but it is not there.  The string was even still highlighted in my 
editor.  At this point I blame the 'git commit' command for erasing that 
line.

David Daney

>
>> The other huge page constants in the if(pmd_huge()) block are likewise
>> defined, so we can get rid of the #ifdef CONFIG_HUGETLB_PAGE an let
>> the compiler optimize this block away instead.  Doing this the code
>> has a much cleaner appearance.
>
>> Signed-off-by: David Daney<david.daney@cavium.com>
>
> WBR, Sergei
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-21 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-18 21:30 [PATCH] MIPS: Get rid of some #ifdefery in arch/mips/mm/tlb-r4k.c David Daney
2011-11-21 10:31 ` Sergei Shtylyov
2011-11-21 18:16   ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox