All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
@ 2013-08-13  9:01 ` Markos Chandras
  0 siblings, 0 replies; 7+ messages in thread
From: Markos Chandras @ 2013-08-13  9:01 UTC (permalink / raw)
  To: linux-mips; +Cc: Markos Chandras

Fixes the following build error:
arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
In file included from arch/mips/ath79/common.c:20:0:
arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
arch/mips/include/asm/mach-ath79/ath79.h:139:20:
error: 'reg' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
arch/mips/ath79/common.c:90:6: note: 'reg' was declared here

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
This patch is for the upstream-sfr/mips-for-linux-next tree
---
 arch/mips/ath79/common.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index eb3966c..6a8c00f 100644
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -62,20 +62,22 @@ void ath79_device_reset_set(u32 mask)
 	u32 reg;
 	u32 t;
 
-	if (soc_is_ar71xx())
+	if (soc_is_ar71xx()) {
 		reg = AR71XX_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar724x())
+	} else if (soc_is_ar724x()) {
 		reg = AR724X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar913x())
+	} else if (soc_is_ar913x()) {
 		reg = AR913X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar933x())
+	} else if (soc_is_ar933x()) {
 		reg = AR933X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar934x())
+	} else if (soc_is_ar934x()) {
 		reg = AR934X_RESET_REG_RESET_MODULE;
-	else if (soc_is_qca955x())
+	} else if (soc_is_qca955x()) {
 		reg = QCA955X_RESET_REG_RESET_MODULE;
-	else
+	} else {
 		BUG();
+		panic("Unknown SOC!");
+	}
 
 	spin_lock_irqsave(&ath79_device_reset_lock, flags);
 	t = ath79_reset_rr(reg);
@@ -90,20 +92,22 @@ void ath79_device_reset_clear(u32 mask)
 	u32 reg;
 	u32 t;
 
-	if (soc_is_ar71xx())
+	if (soc_is_ar71xx()) {
 		reg = AR71XX_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar724x())
+	} else if (soc_is_ar724x()) {
 		reg = AR724X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar913x())
+	} else if (soc_is_ar913x()) {
 		reg = AR913X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar933x())
+	} else if (soc_is_ar933x()) {
 		reg = AR933X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar934x())
+	} else if (soc_is_ar934x()) {
 		reg = AR934X_RESET_REG_RESET_MODULE;
-	else if (soc_is_qca955x())
+	} else if (soc_is_qca955x()) {
 		reg = QCA955X_RESET_REG_RESET_MODULE;
-	else
+	} else {
 		BUG();
+		panic("Unknown SOC!");
+	}
 
 	spin_lock_irqsave(&ath79_device_reset_lock, flags);
 	t = ath79_reset_rr(reg);
-- 
1.8.3.2

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

* [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
@ 2013-08-13  9:01 ` Markos Chandras
  0 siblings, 0 replies; 7+ messages in thread
From: Markos Chandras @ 2013-08-13  9:01 UTC (permalink / raw)
  To: linux-mips; +Cc: Markos Chandras

Fixes the following build error:
arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
In file included from arch/mips/ath79/common.c:20:0:
arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
arch/mips/include/asm/mach-ath79/ath79.h:139:20:
error: 'reg' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
arch/mips/ath79/common.c:90:6: note: 'reg' was declared here

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
This patch is for the upstream-sfr/mips-for-linux-next tree
---
 arch/mips/ath79/common.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index eb3966c..6a8c00f 100644
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -62,20 +62,22 @@ void ath79_device_reset_set(u32 mask)
 	u32 reg;
 	u32 t;
 
-	if (soc_is_ar71xx())
+	if (soc_is_ar71xx()) {
 		reg = AR71XX_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar724x())
+	} else if (soc_is_ar724x()) {
 		reg = AR724X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar913x())
+	} else if (soc_is_ar913x()) {
 		reg = AR913X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar933x())
+	} else if (soc_is_ar933x()) {
 		reg = AR933X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar934x())
+	} else if (soc_is_ar934x()) {
 		reg = AR934X_RESET_REG_RESET_MODULE;
-	else if (soc_is_qca955x())
+	} else if (soc_is_qca955x()) {
 		reg = QCA955X_RESET_REG_RESET_MODULE;
-	else
+	} else {
 		BUG();
+		panic("Unknown SOC!");
+	}
 
 	spin_lock_irqsave(&ath79_device_reset_lock, flags);
 	t = ath79_reset_rr(reg);
@@ -90,20 +92,22 @@ void ath79_device_reset_clear(u32 mask)
 	u32 reg;
 	u32 t;
 
-	if (soc_is_ar71xx())
+	if (soc_is_ar71xx()) {
 		reg = AR71XX_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar724x())
+	} else if (soc_is_ar724x()) {
 		reg = AR724X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar913x())
+	} else if (soc_is_ar913x()) {
 		reg = AR913X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar933x())
+	} else if (soc_is_ar933x()) {
 		reg = AR933X_RESET_REG_RESET_MODULE;
-	else if (soc_is_ar934x())
+	} else if (soc_is_ar934x()) {
 		reg = AR934X_RESET_REG_RESET_MODULE;
-	else if (soc_is_qca955x())
+	} else if (soc_is_qca955x()) {
 		reg = QCA955X_RESET_REG_RESET_MODULE;
-	else
+	} else {
 		BUG();
+		panic("Unknown SOC!");
+	}
 
 	spin_lock_irqsave(&ath79_device_reset_lock, flags);
 	t = ath79_reset_rr(reg);
-- 
1.8.3.2

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

* Re: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  2013-08-13  9:01 ` Markos Chandras
  (?)
@ 2013-08-14 10:42 ` Gabor Juhos
  -1 siblings, 0 replies; 7+ messages in thread
From: Gabor Juhos @ 2013-08-14 10:42 UTC (permalink / raw)
  To: Markos Chandras; +Cc: linux-mips

2013.08.13. 11:01 keltezéssel, Markos Chandras írta:
> Fixes the following build error:
> arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
> arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
> In file included from arch/mips/ath79/common.c:20:0:
> arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
> arch/mips/include/asm/mach-ath79/ath79.h:139:20:
> error: 'reg' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
> 
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Acked-by: Gabor Juhos <juhosg@openwrt.org>

Thanks,
Gabor

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

* Re: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  2013-08-13  9:01 ` Markos Chandras
  (?)
  (?)
@ 2013-08-14 11:12 ` Jonas Gorski
  2013-08-15 13:42   ` Markos Chandras
  -1 siblings, 1 reply; 7+ messages in thread
From: Jonas Gorski @ 2013-08-14 11:12 UTC (permalink / raw)
  To: Markos Chandras; +Cc: linux-mips

Hi,

On Tue, Aug 13, 2013 at 11:01 AM, Markos Chandras
<markos.chandras@imgtec.com> wrote:
> Fixes the following build error:
> arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
> uninitialized in this function [-Werror=maybe-uninitialized]
> arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
> In file included from arch/mips/ath79/common.c:20:0:
> arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
> arch/mips/include/asm/mach-ath79/ath79.h:139:20:
> error: 'reg' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
> arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
>
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
> ---
> This patch is for the upstream-sfr/mips-for-linux-next tree
> ---
>  arch/mips/ath79/common.c | 32 ++++++++++++++++++--------------
>  1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
> index eb3966c..6a8c00f 100644
> --- a/arch/mips/ath79/common.c
> +++ b/arch/mips/ath79/common.c
> @@ -62,20 +62,22 @@ void ath79_device_reset_set(u32 mask)
>         u32 reg;
>         u32 t;
>
> -       if (soc_is_ar71xx())
> +       if (soc_is_ar71xx()) {
>                 reg = AR71XX_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar724x())
> +       } else if (soc_is_ar724x()) {
>                 reg = AR724X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar913x())
> +       } else if (soc_is_ar913x()) {
>                 reg = AR913X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar933x())
> +       } else if (soc_is_ar933x()) {
>                 reg = AR933X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar934x())
> +       } else if (soc_is_ar934x()) {
>                 reg = AR934X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_qca955x())
> +       } else if (soc_is_qca955x()) {
>                 reg = QCA955X_RESET_REG_RESET_MODULE;
> -       else
> +       } else {
>                 BUG();
> +               panic("Unknown SOC!");

Both BUG() and panic() seems to be a bit overkill, especially since
the panic won't be reached unless BUG is disabled - just the panic()
should be enough.

Also the panic message isn't very helpful, maybe print the raw id of
the SoC here?

> +       }
>
>         spin_lock_irqsave(&ath79_device_reset_lock, flags);
>         t = ath79_reset_rr(reg);
> @@ -90,20 +92,22 @@ void ath79_device_reset_clear(u32 mask)
>         u32 reg;
>         u32 t;
>
> -       if (soc_is_ar71xx())
> +       if (soc_is_ar71xx()) {
>                 reg = AR71XX_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar724x())
> +       } else if (soc_is_ar724x()) {
>                 reg = AR724X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar913x())
> +       } else if (soc_is_ar913x()) {
>                 reg = AR913X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar933x())
> +       } else if (soc_is_ar933x()) {
>                 reg = AR933X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_ar934x())
> +       } else if (soc_is_ar934x()) {
>                 reg = AR934X_RESET_REG_RESET_MODULE;
> -       else if (soc_is_qca955x())
> +       } else if (soc_is_qca955x()) {
>                 reg = QCA955X_RESET_REG_RESET_MODULE;
> -       else
> +       } else {
>                 BUG();
> +               panic("Unknown SOC!");

Same comment here.

> +       }
>
>         spin_lock_irqsave(&ath79_device_reset_lock, flags);
>         t = ath79_reset_rr(reg);
> --
> 1.8.3.2


Regards
Jonas

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

* Re: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  2013-08-14 11:12 ` Jonas Gorski
@ 2013-08-15 13:42   ` Markos Chandras
  2013-08-16 12:34     ` Markos Chandras
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2013-08-15 13:42 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: Markos Chandras, linux-mips

On 14 August 2013 12:12, Jonas Gorski <jogo@openwrt.org> wrote:
> Hi,
>
> On Tue, Aug 13, 2013 at 11:01 AM, Markos Chandras
> <markos.chandras@imgtec.com> wrote:
>> Fixes the following build error:
>> arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
>> uninitialized in this function [-Werror=maybe-uninitialized]
>> arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
>> In file included from arch/mips/ath79/common.c:20:0:
>> arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
>> arch/mips/include/asm/mach-ath79/ath79.h:139:20:
>> error: 'reg' may be used uninitialized in this function
>> [-Werror=maybe-uninitialized]
>> arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
>>
>> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>> ---
>> This patch is for the upstream-sfr/mips-for-linux-next tree
>> ---
>>  arch/mips/ath79/common.c | 32 ++++++++++++++++++--------------
>>  1 file changed, 18 insertions(+), 14 deletions(-)
>>
>> diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
>> index eb3966c..6a8c00f 100644
>> --- a/arch/mips/ath79/common.c
>> +++ b/arch/mips/ath79/common.c
>> @@ -62,20 +62,22 @@ void ath79_device_reset_set(u32 mask)
>>         u32 reg;
>>         u32 t;
>>
>> -       if (soc_is_ar71xx())
>> +       if (soc_is_ar71xx()) {
>>                 reg = AR71XX_RESET_REG_RESET_MODULE;
>> -       else if (soc_is_ar724x())
>> +       } else if (soc_is_ar724x()) {
>>                 reg = AR724X_RESET_REG_RESET_MODULE;
>> -       else if (soc_is_ar913x())
>> +       } else if (soc_is_ar913x()) {
>>                 reg = AR913X_RESET_REG_RESET_MODULE;
>> -       else if (soc_is_ar933x())
>> +       } else if (soc_is_ar933x()) {
>>                 reg = AR933X_RESET_REG_RESET_MODULE;
>> -       else if (soc_is_ar934x())
>> +       } else if (soc_is_ar934x()) {
>>                 reg = AR934X_RESET_REG_RESET_MODULE;
>> -       else if (soc_is_qca955x())
>> +       } else if (soc_is_qca955x()) {
>>                 reg = QCA955X_RESET_REG_RESET_MODULE;
>> -       else
>> +       } else {
>>                 BUG();
>> +               panic("Unknown SOC!");
>
> Both BUG() and panic() seems to be a bit overkill, especially since
> the panic won't be reached unless BUG is disabled - just the panic()
> should be enough.
>
> Also the panic message isn't very helpful, maybe print the raw id of
> the SoC here?
>
>

Hi Jonas,

Thank you for the review. I will submit a new patch.

-- 
Regards,
Markos Chandras

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

* Re: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  2013-08-15 13:42   ` Markos Chandras
@ 2013-08-16 12:34     ` Markos Chandras
  2013-08-16 13:57       ` Gabor Juhos
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2013-08-16 12:34 UTC (permalink / raw)
  To: Jonas Gorski; +Cc: Markos Chandras, linux-mips

On 15 August 2013 14:42, Markos Chandras <markos.chandras@gmail.com> wrote:
> On 14 August 2013 12:12, Jonas Gorski <jogo@openwrt.org> wrote:
>> Hi,
>>
>> On Tue, Aug 13, 2013 at 11:01 AM, Markos Chandras
>> <markos.chandras@imgtec.com> wrote:
>>> Fixes the following build error:
>>> arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
>>> In file included from arch/mips/ath79/common.c:20:0:
>>> arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
>>> arch/mips/include/asm/mach-ath79/ath79.h:139:20:
>>> error: 'reg' may be used uninitialized in this function
>>> [-Werror=maybe-uninitialized]
>>> arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
>>>
>>> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>>> ---
>>> This patch is for the upstream-sfr/mips-for-linux-next tree
>>> ---
>>>  arch/mips/ath79/common.c | 32 ++++++++++++++++++--------------
>>>  1 file changed, 18 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
>>> index eb3966c..6a8c00f 100644
>>> --- a/arch/mips/ath79/common.c
>>> +++ b/arch/mips/ath79/common.c
>>> @@ -62,20 +62,22 @@ void ath79_device_reset_set(u32 mask)
>>>         u32 reg;
>>>         u32 t;
>>>
>>> -       if (soc_is_ar71xx())
>>> +       if (soc_is_ar71xx()) {
>>>                 reg = AR71XX_RESET_REG_RESET_MODULE;
>>> -       else if (soc_is_ar724x())
>>> +       } else if (soc_is_ar724x()) {
>>>                 reg = AR724X_RESET_REG_RESET_MODULE;
>>> -       else if (soc_is_ar913x())
>>> +       } else if (soc_is_ar913x()) {
>>>                 reg = AR913X_RESET_REG_RESET_MODULE;
>>> -       else if (soc_is_ar933x())
>>> +       } else if (soc_is_ar933x()) {
>>>                 reg = AR933X_RESET_REG_RESET_MODULE;
>>> -       else if (soc_is_ar934x())
>>> +       } else if (soc_is_ar934x()) {
>>>                 reg = AR934X_RESET_REG_RESET_MODULE;
>>> -       else if (soc_is_qca955x())
>>> +       } else if (soc_is_qca955x()) {
>>>                 reg = QCA955X_RESET_REG_RESET_MODULE;
>>> -       else
>>> +       } else {
>>>                 BUG();
>>> +               panic("Unknown SOC!");
>>
>> Both BUG() and panic() seems to be a bit overkill, especially since
>> the panic won't be reached unless BUG is disabled - just the panic()
>> should be enough.
>>
>> Also the panic message isn't very helpful, maybe print the raw id of
>> the SoC here?
>>
>>
>
> Hi Jonas,
>
> Thank you for the review. I will submit a new patch.
>
> --
> Regards,
> Markos Chandras

Hi Jonas,

I had a look at the code again and it seems that reporting the 'id' is
not needed since an unknown SOC will cause a panic
earlier in the boot process. Look at arch/mips/ath79/setup.c, in the
plat_mem_setup function.
This one calls ath79_detect_sys_type which causes the following panic
if an unknown SOC is detected.

panic("ath79: unknown SoC, id:0x%08x", id);

This makes me think that ath79_device_reset_set and
ath79_device_reset_clear should not care about an unknown SOC at all.

-- 
Regards,
Markos Chandras

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

* Re: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  2013-08-16 12:34     ` Markos Chandras
@ 2013-08-16 13:57       ` Gabor Juhos
  0 siblings, 0 replies; 7+ messages in thread
From: Gabor Juhos @ 2013-08-16 13:57 UTC (permalink / raw)
  To: Markos Chandras; +Cc: Jonas Gorski, Markos Chandras, linux-mips

Hi Markos,
> On 15 August 2013 14:42, Markos Chandras <markos.chandras@gmail.com> wrote:
>> On 14 August 2013 12:12, Jonas Gorski <jogo@openwrt.org> wrote:
>>> Hi,
>>>
>>> On Tue, Aug 13, 2013 at 11:01 AM, Markos Chandras
>>> <markos.chandras@imgtec.com> wrote:
>>>> Fixes the following build error:
>>>> arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
>>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>>> arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
>>>> In file included from arch/mips/ath79/common.c:20:0:
>>>> arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
>>>> arch/mips/include/asm/mach-ath79/ath79.h:139:20:
>>>> error: 'reg' may be used uninitialized in this function
>>>> [-Werror=maybe-uninitialized]
>>>> arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
>>>>
>>>> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>>>> ---

<snip>

>>>> +       } else {
>>>>                 BUG();
>>>> +               panic("Unknown SOC!");
>>>
>>> Both BUG() and panic() seems to be a bit overkill, especially since
>>> the panic won't be reached unless BUG is disabled - just the panic()
>>> should be enough.
>>>
>>> Also the panic message isn't very helpful, maybe print the raw id of
>>> the SoC here?
>>>
>>>
>>
>> Hi Jonas,
>>
>> Thank you for the review. I will submit a new patch.
>>
>> --
>> Regards,
>> Markos Chandras
> 
> Hi Jonas,
> 
> I had a look at the code again and it seems that reporting the 'id' is
> not needed since an unknown SOC will cause a panic
> earlier in the boot process. Look at arch/mips/ath79/setup.c, in the
> plat_mem_setup function.
> This one calls ath79_detect_sys_type which causes the following panic
> if an unknown SOC is detected.
> 
> panic("ath79: unknown SoC, id:0x%08x", id);
> 
> This makes me think that ath79_device_reset_set and
> ath79_device_reset_clear should not care about an unknown SOC at all.
> 

The BUG() call helps to ensure that the ath79_device_reset{clear,set} functions
will be modified when someone adds support for a new SoC. So I prefer to have a
panic() or at least a WARN()+return here. However, instead of the 'Unknown SoC!'
message, a 'reset register is not defined for the SoC' text would be more
meaningful given the actual context.

-Gabor

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

end of thread, other threads:[~2013-08-16 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13  9:01 [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable Markos Chandras
2013-08-13  9:01 ` Markos Chandras
2013-08-14 10:42 ` Gabor Juhos
2013-08-14 11:12 ` Jonas Gorski
2013-08-15 13:42   ` Markos Chandras
2013-08-16 12:34     ` Markos Chandras
2013-08-16 13:57       ` Gabor Juhos

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.