* [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
@ 2011-05-13 15:28 Alexander Clouter
2011-05-13 15:31 ` Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Alexander Clouter @ 2011-05-13 15:28 UTC (permalink / raw)
To: linux-mips; +Cc: florian
CC arch/mips/ar7/gpio.o
arch/mips/ar7/gpio.c: In function 'ar7_gpio_init':
arch/mips/ar7/gpio.c:318:11: error: variable 'size' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
arch/mips/ar7/gpio.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index 425dfa5..6917427 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -314,16 +314,8 @@ static void titan_gpio_init(void)
int __init ar7_gpio_init(void)
{
int ret;
- struct ar7_gpio_chip *gpch;
- unsigned size;
-
- if (!ar7_is_titan()) {
- gpch = &ar7_gpio_chip;
- size = 0x10;
- } else {
- gpch = &titan_gpio_chip;
- size = 0x1f;
- }
+ struct ar7_gpio_chip *gpch = (!ar7_is_titan())
+ ? &ar7_gpio_chip : &titan_gpio_chip;
gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
AR7_REGS_GPIO + 0x10);
--
1.7.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
2011-05-13 15:28 [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error Alexander Clouter
@ 2011-05-13 15:31 ` Sergei Shtylyov
2011-05-13 15:50 ` Alexander Clouter
2011-05-13 15:52 ` Florian Fainelli
2011-05-13 16:20 ` Jonas Gorski
2 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2011-05-13 15:31 UTC (permalink / raw)
To: Alexander Clouter; +Cc: linux-mips, florian
Hello.
Alexander Clouter wrote:
> CC arch/mips/ar7/gpio.o
> arch/mips/ar7/gpio.c: In function 'ar7_gpio_init':
> arch/mips/ar7/gpio.c:318:11: error: variable 'size' set but not used [-Werror=unused-but-set-variable]
> cc1: all warnings being treated as errors
> Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
> ---
> arch/mips/ar7/gpio.c | 12 ++----------
> 1 files changed, 2 insertions(+), 10 deletions(-)
> diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
> index 425dfa5..6917427 100644
> --- a/arch/mips/ar7/gpio.c
> +++ b/arch/mips/ar7/gpio.c
> @@ -314,16 +314,8 @@ static void titan_gpio_init(void)
> int __init ar7_gpio_init(void)
> {
> int ret;
> - struct ar7_gpio_chip *gpch;
> - unsigned size;
> -
> - if (!ar7_is_titan()) {
> - gpch = &ar7_gpio_chip;
> - size = 0x10;
> - } else {
> - gpch = &titan_gpio_chip;
> - size = 0x1f;
> - }
> + struct ar7_gpio_chip *gpch = (!ar7_is_titan())
Parens around (!x) are not really necessary. Perhaps Ralf could remove them
while applying...
> + ? &ar7_gpio_chip : &titan_gpio_chip;
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
2011-05-13 15:31 ` Sergei Shtylyov
@ 2011-05-13 15:50 ` Alexander Clouter
2011-05-13 16:30 ` Ralf Baechle
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Clouter @ 2011-05-13 15:50 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-mips, florian
* Sergei Shtylyov <sshtylyov@mvista.com> [2011-05-13 19:31:21+0400]:
>
> >+ struct ar7_gpio_chip *gpch = (!ar7_is_titan())
>
> Parens around (!x) are not really necessary. Perhaps Ralf could
> remove them while applying...
>
I'm happy to resubmit if that is preferred.
Cheers
--
Alexander Clouter
.sigmonster says: BOFH excuse #267:
The UPS is on strike.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
2011-05-13 15:50 ` Alexander Clouter
@ 2011-05-13 16:30 ` Ralf Baechle
2011-05-13 16:39 ` Ralf Baechle
0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2011-05-13 16:30 UTC (permalink / raw)
To: Alexander Clouter; +Cc: Sergei Shtylyov, linux-mips, florian
On Fri, May 13, 2011 at 04:50:30PM +0100, Alexander Clouter wrote:
> > >+ struct ar7_gpio_chip *gpch = (!ar7_is_titan())
> >
> > Parens around (!x) are not really necessary. Perhaps Ralf could
> > remove them while applying...
> >
> I'm happy to resubmit if that is preferred.
Florian who is experiencing email problems submitted an alternative patch
to me which I'm appending below and which I've just applied.
Thanks folks!
Ralf
From: Florian Fainelli <florian@openwrt.org>
Date: Fri, 13 May 2011 17:41:21 +0200
Subject: [PATCH] MIPS: AR7: Fix GPIO register size for Titan variant.
The 'size' variable contains the correct register size for both AR7
and Titan, but we never used it to ioremap the correct register size.
This problem only shows up on Titan.
Reported-by: Alexander Clouter <alex@digriz.org.uk>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
arch/mips/ar7/gpio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index 425dfa5..a8aa1b4 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -326,7 +326,7 @@ int __init ar7_gpio_init(void)
}
gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
- AR7_REGS_GPIO + 0x10);
+ AR7_REGS_GPIO + size);
if (!gpch->regs) {
printk(KERN_ERR "%s: failed to ioremap regs\n",
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
2011-05-13 15:28 [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error Alexander Clouter
2011-05-13 15:31 ` Sergei Shtylyov
@ 2011-05-13 15:52 ` Florian Fainelli
2011-05-13 16:20 ` Jonas Gorski
2 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2011-05-13 15:52 UTC (permalink / raw)
To: Alexander Clouter; +Cc: linux-mips
Hello Alexander,
On Friday 13 May 2011 17:28:55 Alexander Clouter wrote:
> CC arch/mips/ar7/gpio.o
> arch/mips/ar7/gpio.c: In function 'ar7_gpio_init':
> arch/mips/ar7/gpio.c:318:11: error: variable 'size' set but not used
> [-Werror=unused-but-set-variable] cc1: all warnings being treated as
> errors
>
> Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
> ---
> arch/mips/ar7/gpio.c | 12 ++----------
> 1 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
> index 425dfa5..6917427 100644
> --- a/arch/mips/ar7/gpio.c
> +++ b/arch/mips/ar7/gpio.c
> @@ -314,16 +314,8 @@ static void titan_gpio_init(void)
> int __init ar7_gpio_init(void)
> {
> int ret;
> - struct ar7_gpio_chip *gpch;
> - unsigned size;
> -
> - if (!ar7_is_titan()) {
> - gpch = &ar7_gpio_chip;
> - size = 0x10;
> - } else {
> - gpch = &titan_gpio_chip;
> - size = 0x1f;
> - }
> + struct ar7_gpio_chip *gpch = (!ar7_is_titan())
> + ? &ar7_gpio_chip : &titan_gpio_chip;
>
> gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
> AR7_REGS_GPIO + 0x10);
From: Florian Fainelli <florian@openwrt.org>
Subject: [PATCH] AR7: fix gpio register size for Titan variant.
The 'size' variable contains the correct register size for both AR7
and Titan, but we never used it to ioremap the correct register size.
This problem only shows up on Titan.
Reported-by: Alexander Clouter <alex@digriz.org.uk>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
index 425dfa5..a8aa1b4 100644
--- a/arch/mips/ar7/gpio.c
+++ b/arch/mips/ar7/gpio.c
@@ -326,7 +326,7 @@ int __init ar7_gpio_init(void)
}
gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
- AR7_REGS_GPIO + 0x10);
+ AR7_REGS_GPIO + size);
if (!gpch->regs) {
printk(KERN_ERR "%s: failed to ioremap regs\n",
--
1.7.4.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error.
2011-05-13 15:28 [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error Alexander Clouter
2011-05-13 15:31 ` Sergei Shtylyov
2011-05-13 15:52 ` Florian Fainelli
@ 2011-05-13 16:20 ` Jonas Gorski
2 siblings, 0 replies; 7+ messages in thread
From: Jonas Gorski @ 2011-05-13 16:20 UTC (permalink / raw)
To: Alexander Clouter; +Cc: linux-mips, florian
On 13 May 2011 17:28, Alexander Clouter <alex@digriz.org.uk> wrote:
> CC arch/mips/ar7/gpio.o
> arch/mips/ar7/gpio.c: In function 'ar7_gpio_init':
> arch/mips/ar7/gpio.c:318:11: error: variable 'size' set but not used [-Werror=unused-but-set-variable]
> cc1: all warnings being treated as errors
>
> Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
> ---
> arch/mips/ar7/gpio.c | 12 ++----------
> 1 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
> index 425dfa5..6917427 100644
> --- a/arch/mips/ar7/gpio.c
> +++ b/arch/mips/ar7/gpio.c
> @@ -314,16 +314,8 @@ static void titan_gpio_init(void)
> int __init ar7_gpio_init(void)
> {
> int ret;
> - struct ar7_gpio_chip *gpch;
> - unsigned size;
> -
> - if (!ar7_is_titan()) {
> - gpch = &ar7_gpio_chip;
> - size = 0x10;
> - } else {
> - gpch = &titan_gpio_chip;
> - size = 0x1f;
> - }
> + struct ar7_gpio_chip *gpch = (!ar7_is_titan())
> + ? &ar7_gpio_chip : &titan_gpio_chip;
>
> gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
> AR7_REGS_GPIO + 0x10);
Without any AR7 knowledge, it looks like the size is supposed to be
used here instead of the 0x10 - also the "AR7_REGS_GPIO + 0x10" looks
wrong - I don't think the regs are 0x8610910 bytes big ;-).
Regards
Jonas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-13 17:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 15:28 [PATCH] MIPS: AR7: Fix GCC 4.6.0 build error Alexander Clouter
2011-05-13 15:31 ` Sergei Shtylyov
2011-05-13 15:50 ` Alexander Clouter
2011-05-13 16:30 ` Ralf Baechle
2011-05-13 16:39 ` Ralf Baechle
2011-05-13 15:52 ` Florian Fainelli
2011-05-13 16:20 ` Jonas Gorski
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.