All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value.
@ 2016-01-27 11:22 Moritz Fischer
  2016-01-27 13:15 ` Michal Simek
  0 siblings, 1 reply; 4+ messages in thread
From: Moritz Fischer @ 2016-01-27 11:22 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
---
Hi Michal,

   I was planning to use this in future to boot into recovery mode.
   The change is small enough I feel that we could directly take it.
   If you want to hold off until there's a user that's fine for me, too.

   Cheers,

   Moritz
---
 arch/arm/mach-zynq/slcr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index 05f4099..709711a 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -166,6 +166,11 @@ u32 zynq_slcr_get_boot_mode(void)
 	return readl(&slcr_base->boot_mode);
 }
 
+u32 zynq_slcr_get_reboot_status(void)
+{
+	return readl(&slcr_base->reboot_status);
+}
+
 u32 zynq_slcr_get_idcode(void)
 {
 	return (readl(&slcr_base->pss_idcode) & SLCR_IDCODE_MASK) >>
-- 
2.7.0

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

* [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value.
  2016-01-27 11:22 [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value Moritz Fischer
@ 2016-01-27 13:15 ` Michal Simek
  2016-01-27 13:53   ` Moritz Fischer
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Simek @ 2016-01-27 13:15 UTC (permalink / raw)
  To: u-boot

On 27.1.2016 12:22, Moritz Fischer wrote:
> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
> ---
> Hi Michal,
> 
>    I was planning to use this in future to boot into recovery mode.
>    The change is small enough I feel that we could directly take it.
>    If you want to hold off until there's a user that's fine for me, too.
> 
>    Cheers,
> 
>    Moritz
> ---
>  arch/arm/mach-zynq/slcr.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> index 05f4099..709711a 100644
> --- a/arch/arm/mach-zynq/slcr.c
> +++ b/arch/arm/mach-zynq/slcr.c
> @@ -166,6 +166,11 @@ u32 zynq_slcr_get_boot_mode(void)
>  	return readl(&slcr_base->boot_mode);
>  }
>  
> +u32 zynq_slcr_get_reboot_status(void)
> +{
> +	return readl(&slcr_base->reboot_status);
> +}
> +
>  u32 zynq_slcr_get_idcode(void)
>  {
>  	return (readl(&slcr_base->pss_idcode) & SLCR_IDCODE_MASK) >>
> 

Isn't this generating sparse warning if it is not used and declared?

Thanks,
Michal

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

* [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value.
  2016-01-27 13:15 ` Michal Simek
@ 2016-01-27 13:53   ` Moritz Fischer
  2016-01-27 15:36     ` Albert ARIBAUD
  0 siblings, 1 reply; 4+ messages in thread
From: Moritz Fischer @ 2016-01-27 13:53 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On Wed, Jan 27, 2016 at 2:15 PM, Michal Simek <michal.simek@xilinx.com> wrote:
> On 27.1.2016 12:22, Moritz Fischer wrote:
>> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
>> ---
>> Hi Michal,
>>
>>    I was planning to use this in future to boot into recovery mode.
>>    The change is small enough I feel that we could directly take it.
>>    If you want to hold off until there's a user that's fine for me, too.
>>
>>    Cheers,
>>
>>    Moritz
>> ---
>>  arch/arm/mach-zynq/slcr.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
>> index 05f4099..709711a 100644
>> --- a/arch/arm/mach-zynq/slcr.c
>> +++ b/arch/arm/mach-zynq/slcr.c
>> @@ -166,6 +166,11 @@ u32 zynq_slcr_get_boot_mode(void)
>>       return readl(&slcr_base->boot_mode);
>>  }
>>
>> +u32 zynq_slcr_get_reboot_status(void)
>> +{
>> +     return readl(&slcr_base->reboot_status);
>> +}
>> +
>>  u32 zynq_slcr_get_idcode(void)
>>  {
>>       return (readl(&slcr_base->pss_idcode) & SLCR_IDCODE_MASK) >>
>>
>
> Isn't this generating sparse warning if it is not used and declared?

Derp. It doesn't generate a warning for not being used, however for
not being declared it does,
the entry in sys_proto.h is missing:

  CHECK   arch/arm/mach-zynq/slcr.c
arch/arm/mach-zynq/slcr.c:97:9: warning: cast to restricted __le32
arch/arm/mach-zynq/slcr.c:97:9: warning: incorrect type in assignment
(different base types)
arch/arm/mach-zynq/slcr.c:97:9:    expected unsigned int volatile
[unsigned] <noident>
arch/arm/mach-zynq/slcr.c:97:9:    got restricted __le32 [usertype] <noident>
arch/arm/mach-zynq/slcr.c:169:5: warning: symbol
'zynq_slcr_get_reboot_status' was not declared. Should it be static?
  CC      arch/arm/mach-zynq/slcr.o
  LD      arch/arm/mach-zynq/built-in.o

when added to header this becomes:

  CHECK   arch/arm/mach-zynq/slcr.c
arch/arm/mach-zynq/slcr.c:97:9: warning: cast to restricted __le32
arch/arm/mach-zynq/slcr.c:97:9: warning: incorrect type in assignment
(different base types)
arch/arm/mach-zynq/slcr.c:97:9:    expected unsigned int volatile
[unsigned] <noident>
arch/arm/mach-zynq/slcr.c:97:9:    got restricted __le32 [usertype] <noident>
  CC      arch/arm/mach-zynq/slcr.o
  LD      arch/arm/mach-zynq/built-in.o

These were there before ;-)

I can resend with the header line added,

Moritz

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

* [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value.
  2016-01-27 13:53   ` Moritz Fischer
@ 2016-01-27 15:36     ` Albert ARIBAUD
  0 siblings, 0 replies; 4+ messages in thread
From: Albert ARIBAUD @ 2016-01-27 15:36 UTC (permalink / raw)
  To: u-boot

Hello Moritz,

On Wed, 27 Jan 2016 14:53:30 +0100, Moritz Fischer
<moritz.fischer@ettus.com> wrote:
> Hi Michal,
> 
> On Wed, Jan 27, 2016 at 2:15 PM, Michal Simek <michal.simek@xilinx.com> wrote:
> > On 27.1.2016 12:22, Moritz Fischer wrote:
> >> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
> >> ---
> >> Hi Michal,
> >>
> >>    I was planning to use this in future to boot into recovery mode.
> >>    The change is small enough I feel that we could directly take it.
> >>    If you want to hold off until there's a user that's fine for me, too.
> >>
> >>    Cheers,
> >>
> >>    Moritz
> >> ---
> >>  arch/arm/mach-zynq/slcr.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> >> index 05f4099..709711a 100644
> >> --- a/arch/arm/mach-zynq/slcr.c
> >> +++ b/arch/arm/mach-zynq/slcr.c
> >> @@ -166,6 +166,11 @@ u32 zynq_slcr_get_boot_mode(void)
> >>       return readl(&slcr_base->boot_mode);
> >>  }
> >>
> >> +u32 zynq_slcr_get_reboot_status(void)
> >> +{
> >> +     return readl(&slcr_base->reboot_status);
> >> +}
> >> +
> >>  u32 zynq_slcr_get_idcode(void)
> >>  {
> >>       return (readl(&slcr_base->pss_idcode) & SLCR_IDCODE_MASK) >>
> >>
> >
> > Isn't this generating sparse warning if it is not used and declared?
> 
> Derp. It doesn't generate a warning for not being used, however for
> not being declared it does,
> the entry in sys_proto.h is missing:
> 
>   CHECK   arch/arm/mach-zynq/slcr.c
> arch/arm/mach-zynq/slcr.c:97:9: warning: cast to restricted __le32
> arch/arm/mach-zynq/slcr.c:97:9: warning: incorrect type in assignment
> (different base types)
> arch/arm/mach-zynq/slcr.c:97:9:    expected unsigned int volatile
> [unsigned] <noident>
> arch/arm/mach-zynq/slcr.c:97:9:    got restricted __le32 [usertype] <noident>
> arch/arm/mach-zynq/slcr.c:169:5: warning: symbol
> 'zynq_slcr_get_reboot_status' was not declared. Should it be static?
>   CC      arch/arm/mach-zynq/slcr.o
>   LD      arch/arm/mach-zynq/built-in.o
> 
> when added to header this becomes:
> 
>   CHECK   arch/arm/mach-zynq/slcr.c
> arch/arm/mach-zynq/slcr.c:97:9: warning: cast to restricted __le32
> arch/arm/mach-zynq/slcr.c:97:9: warning: incorrect type in assignment
> (different base types)
> arch/arm/mach-zynq/slcr.c:97:9:    expected unsigned int volatile
> [unsigned] <noident>
> arch/arm/mach-zynq/slcr.c:97:9:    got restricted __le32 [usertype] <noident>
>   CC      arch/arm/mach-zynq/slcr.o
>   LD      arch/arm/mach-zynq/built-in.o
> 
> These were there before ;-)
> 
> I can resend with the header line added,
> 
> Moritz

Please add the header line but I would prefer that you submit it
as part of the series where it is used. Changes small enough to be
taken directly can end up dead code just like bigger changes, only
harder to locate -- especially if the compiler does not complain about
them. :)

Amicalement,
-- 
Albert.

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

end of thread, other threads:[~2016-01-27 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 11:22 [U-Boot] [PATCH] ARM: zynq: Add function to get reboot status register value Moritz Fischer
2016-01-27 13:15 ` Michal Simek
2016-01-27 13:53   ` Moritz Fischer
2016-01-27 15:36     ` Albert ARIBAUD

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.