From: Mike Frysinger Date: Mon, 7 Mar 2011 16:40:46 -0500 Subject: [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart() In-Reply-To: <1299519462-25320-2-git-send-email-Kyle.D.Moffett@boeing.com> References: <1299519462-25320-1-git-send-email-Kyle.D.Moffett@boeing.com> <1299519462-25320-2-git-send-email-Kyle.D.Moffett@boeing.com> Message-ID: <201103071640.46948.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, March 07, 2011 12:37:22 Kyle Moffett wrote: > +__attribute__((__noreturn__)) > +void emergency_restart(void) > +{ > + __board_emergency_restart(); > + __arch_emergency_restart(); > + > + /* Fallback to the old do_reset() until everything is converted. */ > + do_reset(NULL, 0, 0, NULL); > + > + printf("EMERGENCY RESTART: All attempts to reboot failed!"); missing a trailing newline, and i'd just call puts() to bypass useless format string parsing > +int system_restart(void) > +{ > + int err; > + > + /* > + * Print a nice message and wait a bit to make sure it goes out the > + * console properly. > + */ > + printf ("Restarting...\n"); no space before the "(", and i'd use puts() here > + udelay(50000); this doesnt sit well with me. i dont see why this matters ... we dont have any delays today, and i dont think we should introduce any. > + printf("*** SYSTEM RESTART FAILED ***\n"); puts() > +__attribute__((__weak__)) > +int __board_restart(void) > +{ > + /* Fallthrough to architecture-specific code */ > + return 0; > +} > + > +__attribute__((__weak__)) > +int __arch_restart(void) > +{ > + /* Fallthrough to legacy do_reset() code */ > + return 0; > +} what use is there in having a return value ? the do_reset() funcs today dont return, which means they have no meaningful reset value. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110307/c82df44f/attachment.pgp