* [PATCH 0/1] ppc64: fix build error when compiling with gcc-4.6.0
@ 2011-04-18 16:38 Stratos Psomadakis
2011-04-18 16:38 ` [PATCH 1/1] " Stratos Psomadakis
0 siblings, 1 reply; 4+ messages in thread
From: Stratos Psomadakis @ 2011-04-18 16:38 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev
The build error was reported at the Gentoo Bugzilla [1].
When compiling with gcc-4.6.0, a build error occurs:
"variable ‘old’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors"
This patch removes the unnecessary assignments to the variable, which cause
the compiler warning (used but not set), and build failure, and removes it
completely.
I think it's ok to do that, since the variable wasn't actually used anywhere
inside those two functions that caused the warning. Right?
[1] https://bugs.gentoo.org/show_bug.cgi?id=363935
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
2011-04-18 16:38 [PATCH 0/1] ppc64: fix build error when compiling with gcc-4.6.0 Stratos Psomadakis
@ 2011-04-18 16:38 ` Stratos Psomadakis
2011-04-18 16:51 ` Stratos Psomadakis
2011-04-18 17:00 ` Stratos Psomadakis
0 siblings, 2 replies; 4+ messages in thread
From: Stratos Psomadakis @ 2011-04-18 16:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis, linuxppc-dev
variable 'old' is set but not used, which results to a warning
(-Werror=unused-but-set-variable) when compiling with gcc-4.6.0, and subsequent
build failure.
Remove the variable 'old', since it's not used anyway.
---
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..a49d592 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.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
2011-04-18 16:38 ` [PATCH 1/1] " Stratos Psomadakis
@ 2011-04-18 16:51 ` Stratos Psomadakis
2011-04-18 17:00 ` Stratos Psomadakis
1 sibling, 0 replies; 4+ messages in thread
From: Stratos Psomadakis @ 2011-04-18 16:51 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]
On 18/04/2011 07:38 μμ, Stratos Psomadakis wrote:
> variable 'old' is set but not used, which results to a warning
> (-Werror=unused-but-set-variable) when compiling with gcc-4.6.0, and subsequent
> build failure.
> Remove the variable 'old', since it's not used anyway.
Something went wrong with git-send-email :/
So I send the first mail in the chain as a reply:
The build error was reported at the Gentoo Bugzilla [1].
When compiling with gcc-4.6.0, a build error occurs:
"variable ‘old’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors"
This patch removes the unnecessary assignments to the variable 'old', which cause
the compiler warning (used but not set), and build failure, and remove the variable completely.
I think it's ok to do that, since the variable is actually never used. Right?
(of course disabling CONFIG_PPC_WERROR would resolve the build failure, but cleaning up the code a bit, is better I think).
[1] https://bugs.gentoo.org/show_bug.cgi?id=363935
--
Stratos Psomadakis
<psomas@ece.ntua.gr>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
2011-04-18 16:38 ` [PATCH 1/1] " Stratos Psomadakis
2011-04-18 16:51 ` Stratos Psomadakis
@ 2011-04-18 17:00 ` Stratos Psomadakis
1 sibling, 0 replies; 4+ messages in thread
From: Stratos Psomadakis @ 2011-04-18 17:00 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
--
Stratos Psomadakis
<psomas@ece.ntua.gr>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-18 17:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 16:38 [PATCH 0/1] ppc64: fix build error when compiling with gcc-4.6.0 Stratos Psomadakis
2011-04-18 16:38 ` [PATCH 1/1] " Stratos Psomadakis
2011-04-18 16:51 ` Stratos Psomadakis
2011-04-18 17:00 ` Stratos Psomadakis
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).