* [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
@ 2007-05-14 4:11 Stephen Rothwell
2007-05-17 5:16 ` Paul Mackerras
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2007-05-14 4:11 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context':
arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context'
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/mm/mmu_context_64.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 7a78cdc..d263f88 100644
--- a/arch/powerpc/mm/mmu_context_64.c
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -28,7 +28,9 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
int index;
int err;
+#ifdef CONFIG_PPC_MM_SLICES
int new_context = (mm->context.id == 0);
+#endif
again:
if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
--
1.5.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
2007-05-14 4:11 Stephen Rothwell
@ 2007-05-17 5:16 ` Paul Mackerras
2007-05-17 6:03 ` Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2007-05-17 5:16 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev
Stephen Rothwell writes:
> arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context':
> arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context'
> +#ifdef CONFIG_PPC_MM_SLICES
> int new_context = (mm->context.id == 0);
> +#endif
Could we use __unused to suppress the warning instead?
Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
2007-05-17 5:16 ` Paul Mackerras
@ 2007-05-17 6:03 ` Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2007-05-17 6:03 UTC (permalink / raw)
To: Paul Mackerras; +Cc: ppc-dev
arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context':
arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context'
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/mm/mmu_context_64.c | 5 ++---
arch/powerpc/mm/slice.c | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
On Thu, 17 May 2007 15:16:00 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> Could we use __unused to suppress the warning instead?
New version gets rid of the variabled completely. Benh says this is ok.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 7a78cdc..901ea76 100644
--- a/arch/powerpc/mm/mmu_context_64.c
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -28,7 +28,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
int index;
int err;
- int new_context = (mm->context.id == 0);
again:
if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
@@ -50,19 +49,19 @@ again:
return -ENOMEM;
}
- mm->context.id = index;
#ifdef CONFIG_PPC_MM_SLICES
/* The old code would re-promote on fork, we don't do that
* when using slices as it could cause problem promoting slices
* that have been forced down to 4K
*/
- if (new_context)
+ if (mm->context.id == 0)
slice_set_user_psize(mm, mmu_virtual_psize);
#else
mm->context.user_psize = mmu_virtual_psize;
mm->context.sllp = SLB_VSID_USER |
mmu_psize_defs[mmu_virtual_psize].sllp;
#endif
+ mm->context.id = index;
return 0;
}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index f833dba..cde1439 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -549,6 +549,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
*
* This is also called in init_new_context() to change back the user
* psize from whatever the parent context had it set to
+ * N.B. This may be called before mm->context.id has been set.
*
* This function will only change the content of the {low,high)_slice_psize
* masks, it will not flush SLBs as this shall be handled lazily by the
--
1.5.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
@ 2007-08-15 6:33 Stephen Rothwell
2007-08-16 3:55 ` David Gibson
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2007-08-15 6:33 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context':
arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context'
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/mm/mmu_context_64.c | 5 ++---
arch/powerpc/mm/slice.c | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 7a78cdc..901ea76 100644
--- a/arch/powerpc/mm/mmu_context_64.c
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -28,7 +28,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
int index;
int err;
- int new_context = (mm->context.id == 0);
again:
if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
@@ -50,19 +49,19 @@ again:
return -ENOMEM;
}
- mm->context.id = index;
#ifdef CONFIG_PPC_MM_SLICES
/* The old code would re-promote on fork, we don't do that
* when using slices as it could cause problem promoting slices
* that have been forced down to 4K
*/
- if (new_context)
+ if (mm->context.id == 0)
slice_set_user_psize(mm, mmu_virtual_psize);
#else
mm->context.user_psize = mmu_virtual_psize;
mm->context.sllp = SLB_VSID_USER |
mmu_psize_defs[mmu_virtual_psize].sllp;
#endif
+ mm->context.id = index;
return 0;
}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index d5fd390..319826e 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -551,6 +551,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
*
* This is also called in init_new_context() to change back the user
* psize from whatever the parent context had it set to
+ * N.B. This may be called before mm->context.id has been set.
*
* This function will only change the content of the {low,high)_slice_psize
* masks, it will not flush SLBs as this shall be handled lazily by the
--
1.5.2.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
2007-08-15 6:33 [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning Stephen Rothwell
@ 2007-08-16 3:55 ` David Gibson
0 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2007-08-16 3:55 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus
On Wed, Aug 15, 2007 at 04:33:55PM +1000, Stephen Rothwell wrote:
> arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context':
> arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context'
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-16 3:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 6:33 [PATCH] [POWERPC] fix non HUGETLB_PAGE build warning Stephen Rothwell
2007-08-16 3:55 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2007-05-14 4:11 Stephen Rothwell
2007-05-17 5:16 ` Paul Mackerras
2007-05-17 6:03 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).