[PATCH 0/2] ppc/cleaup: Fix compiler warnings

STALE5587d

4 messages, 2 authors, 2011-05-08 · open the first message on its own page

[PATCH 0/2] ppc/cleaup: Fix compiler warnings

From: Stratos Psomadakis <hidden>
Date: 2011-05-07 14:11:48

Fix compiler warnings in ppc code, which can lead to build failure, if
CONFIG_PPC_WERROR is set (default).

 arch/powerpc/include/asm/pgtable-ppc64.h |   13 ++++++-------
 arch/powerpc/kernel/Makefile             |    2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)

[PATCH 2/2] ppc64: Fix compiler warning in pgtable-ppc64.h [-Wunused-but-set-variable]

From: Stratos Psomadakis <hidden>
Date: 2011-05-07 14:11:45

The variable 'old' is set but not used in the wrprotect functions in
arch/powerpc/include/asm/pgtable-ppc64.h, which can trigger a compiler warning.

Remove the variable, since it's not used anyway.

Signed-off-by: Stratos Psomadakis <redacted>
---
 arch/powerpc/include/asm/pgtable-ppc64.h |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 2b09cd5..0b27dba 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -257,21 +257,20 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
 static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
 				      pte_t *ptep)
 {
-	unsigned long old;
 
-       	if ((pte_val(*ptep) & _PAGE_RW) == 0)
-       		return;
-	old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
+	if ((pte_val(*ptep) & _PAGE_RW) == 0)
+		return;
+
+	pte_update(mm, addr, ptep, _PAGE_RW, 0);
 }
 
 static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
 					   unsigned long addr, pte_t *ptep)
 {
-	unsigned long old;
-
 	if ((pte_val(*ptep) & _PAGE_RW) == 0)
 		return;
-	old = pte_update(mm, addr, ptep, _PAGE_RW, 1);
+
+	pte_update(mm, addr, ptep, _PAGE_RW, 1);
 }
 
 /*
-- 
1.5.6.5

[PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]

From: Stratos Psomadakis <hidden>
Date: 2011-05-07 14:11:47

The trick used to bypass the thread_struct fpr array in order to access the
struct fpscr, in arch/powerpc/kernel/ptrace.c, can trigger an "array subscript
is above array bounds [-Werror=array-bounds]" warning.

Add -Wno-array-bounds to CFLAGS_ptrace.o, in arch/powerpc/kernel/Makefile to
slience this warning.

Signed-off-by: Stratos Psomadakis <redacted>
---
 arch/powerpc/kernel/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 3bb2a3e..92b1002 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
+CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' -Wno-array-bounds
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
-- 
1.5.6.5

Re: [PATCH 0/2] ppc/cleaup: Fix compiler warnings

From: Stratos Psomadakis <hidden>
Date: 2011-05-08 20:03:14

On 05/07/2011 05:11 PM, Stratos Psomadakis wrote:
Fix compiler warnings in ppc code, which can lead to build failure, if
CONFIG_PPC_WERROR is set (default).

 arch/powerpc/include/asm/pgtable-ppc64.h |   13 ++++++-------
 arch/powerpc/kernel/Makefile             |    2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)
forgot to cc the maintainers

-- 
Stratos Psomadakis
[off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help