From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH v7 04/11] arm: Support restart through restart handler call chain Date: Thu, 21 Aug 2014 19:19:47 -0700 Message-ID: <20140822021947.GA17788@roeck-us.net> References: <1408495538-27480-1-git-send-email-linux@roeck-us.net> <1408495538-27480-5-git-send-email-linux@roeck-us.net> <53F69DBA.4070806@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <53F69DBA.4070806@suse.de> Sender: linux-samsung-soc-owner@vger.kernel.org To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Doug Anderson , Russell King , Wim Van Sebroeck , Catalin Marinas , Maxime Ripard , Andrew Morton , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Will Deacon , Arnd Bergmann , Heiko Stuebner , Jonas Jensen , Randy Dunlap , Steven Rostedt , Ingo Molnar , Dmitry Eremin-Solenikov , David Woodhouse , Tomasz Figa , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-pm@vger.kernel.org On Fri, Aug 22, 2014 at 03:32:42AM +0200, Andreas F=E4rber wrote: > Hi, >=20 > Am 20.08.2014 02:45, schrieb Guenter Roeck: > > The kernel core now supports a restart handler call chain for syste= m > > restart functions. > >=20 > > With this change, the arm_pm_restart callback is now optional, so > > drop its initialization and check if it is set before calling it. > > Only call the kernel restart handler if arm_pm_restart is not set. > [...] > > diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c > > index 81ef686..ea279f7 100644 > > --- a/arch/arm/kernel/process.c > > +++ b/arch/arm/kernel/process.c > > @@ -114,17 +114,13 @@ void soft_restart(unsigned long addr) > > BUG(); > > } > > =20 > > -static void null_restart(enum reboot_mode reboot_mode, const char = *cmd) > > -{ > > -} > > - > > /* > > * Function pointers to optional machine specific functions > > */ > > void (*pm_power_off)(void); > > EXPORT_SYMBOL(pm_power_off); > > =20 > > -void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *c= md) =3D null_restart; > > +void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *c= md); >=20 > Stupid newbie question maybe, but isn't this variable uninitialized n= ow, > like any non-static variable in C99? Or does the kernel assure that a= ll > such "fields" are zero-initialized? >=20 It is initialized with NULL, like all other global and static variables= in the kernel (and like pm_power_off a few lines above). Guenter