All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ppc/cleaup: Fix compiler warnings
@ 2011-05-07 14:11 ` Stratos Psomadakis
  0 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 14:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel, Stratos Psomadakis

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(-)

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

* [PATCH 0/2] ppc/cleaup: Fix compiler warnings
@ 2011-05-07 14:11 ` Stratos Psomadakis
  0 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 14:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Stratos Psomadakis, linux-kernel

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(-)

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

* [PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]
  2011-05-07 14:11 ` Stratos Psomadakis
  (?)
@ 2011-05-07 14:11 ` Stratos Psomadakis
  2011-05-07 15:18   ` Andreas Schwab
  -1 siblings, 1 reply; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 14:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

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 <psomas@ece.ntua.gr>
---
 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


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

* [PATCH 2/2] ppc64: Fix compiler warning in pgtable-ppc64.h [-Wunused-but-set-variable]
  2011-05-07 14:11 ` Stratos Psomadakis
  (?)
  (?)
@ 2011-05-07 14:11 ` Stratos Psomadakis
  -1 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 14:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

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 <psomas@ece.ntua.gr>
---
 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


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

* Re: [PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]
  2011-05-07 14:11 ` [PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds] Stratos Psomadakis
@ 2011-05-07 15:18   ` Andreas Schwab
  2011-05-07 15:54       ` Stratos Psomadakis
  2011-05-07 15:57     ` [PATCH " Stratos Psomadakis
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Schwab @ 2011-05-07 15:18 UTC (permalink / raw)
  To: Stratos Psomadakis; +Cc: linuxppc-dev, linux-kernel

Stratos Psomadakis <psomas@cslab.ece.ntua.gr> writes:

> +CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' -Wno-array-bounds

You need to check first whether the option is valid.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* [RESEND PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]
  2011-05-07 15:18   ` Andreas Schwab
@ 2011-05-07 15:54       ` Stratos Psomadakis
  2011-05-07 15:57     ` [PATCH " Stratos Psomadakis
  1 sibling, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 15:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel, schwab

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 <psomas@ece.ntua.gr>
---
 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)"' $(call cc-option, -Wno-array-bounds)
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
-- 
1.5.6.5


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

* [RESEND PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]
@ 2011-05-07 15:54       ` Stratos Psomadakis
  0 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 15:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: schwab, linux-kernel

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 <psomas@ece.ntua.gr>
---
 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)"' $(call cc-option, -Wno-array-bounds)
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
-- 
1.5.6.5

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

* Re: [PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds]
  2011-05-07 15:18   ` Andreas Schwab
  2011-05-07 15:54       ` Stratos Psomadakis
@ 2011-05-07 15:57     ` Stratos Psomadakis
  1 sibling, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-07 15:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Stratos Psomadakis, linuxppc-dev, linux-kernel

On 05/07/2011 06:18 PM, Andreas Schwab wrote:
> Stratos Psomadakis <psomas@cslab.ece.ntua.gr> writes:
>
>> +CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' -Wno-array-bounds
> You need to check first whether the option is valid.
>
> Andreas.
>
I resent the patch, with $(call cc-option) to check if GCC supports the
option. Is it ok?

Thx.

-- 
Stratos Psomadakis
<psomas@ece.ntua.gr>


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

* Re: [PATCH 0/2] ppc/cleaup: Fix compiler warnings
  2011-05-07 14:11 ` Stratos Psomadakis
@ 2011-05-08 20:02   ` Stratos Psomadakis
  -1 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-08 20:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel, benh, paulus

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
<psomas@ece.ntua.gr>


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

* Re: [PATCH 0/2] ppc/cleaup: Fix compiler warnings
@ 2011-05-08 20:02   ` Stratos Psomadakis
  0 siblings, 0 replies; 10+ messages in thread
From: Stratos Psomadakis @ 2011-05-08 20:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus, linux-kernel

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
<psomas@ece.ntua.gr>

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

end of thread, other threads:[~2011-05-08 20:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-07 14:11 [PATCH 0/2] ppc/cleaup: Fix compiler warnings Stratos Psomadakis
2011-05-07 14:11 ` Stratos Psomadakis
2011-05-07 14:11 ` [PATCH 1/2] ppc: Fix compiler warning in ptrace.c [-Wno-array-bounds] Stratos Psomadakis
2011-05-07 15:18   ` Andreas Schwab
2011-05-07 15:54     ` [RESEND PATCH " Stratos Psomadakis
2011-05-07 15:54       ` Stratos Psomadakis
2011-05-07 15:57     ` [PATCH " Stratos Psomadakis
2011-05-07 14:11 ` [PATCH 2/2] ppc64: Fix compiler warning in pgtable-ppc64.h [-Wunused-but-set-variable] Stratos Psomadakis
2011-05-08 20:02 ` [PATCH 0/2] ppc/cleaup: Fix compiler warnings Stratos Psomadakis
2011-05-08 20:02   ` Stratos Psomadakis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.