[PATCHv2 1/2] ARM: socfpga: Enable soft reset

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Mar 20 13:44:17 EDT 2013


On Wed, Mar 20, 2013 at 04:29:15PM +0100, Pavel Machek wrote:
> Hi!
> 
> > From: Dinh Nguyen <dinguyen at altera.com>
> > 
> > Enable a cold or warm reset to the HW from userspace.
> > 
> > Also fix a few sparse errors:
> > 
> > warning: symbol 'sys_manager_base_addr' was not declared. Should it be static?
> > warning: symbol 'rst_manager_base_addr' was not declared. Should it be static?
> > 
> > Signed-off-by: Dinh Nguyen <dinguyen at altera.com>
> 
> Tested-by: Pavel Machek <pavel at denx.de>
> 
> Would it make sense to apply something like this? Struct looks cleaner
> than offset defines... 

Structs used to define offsets is technically dodgy according to the C
standards, so I personally really do not like this practice, and I will
not use it ever myself where offsets matter.

Your use is fine though, but only because we know how the compiler behaves
on ARM - and that's a very important point with doing this.  We're reliant
on that compiler behaviour if we go down this path.



More information about the linux-arm-kernel mailing list