[U-Boot] [PATCHv2 3/4] env_nand.c: clarify log messages when env reading fails

Scott Wood scottwood at freescale.com
Mon Feb 25 23:40:04 CET 2013


On 02/25/2013 03:39:12 AM, Phil Sutter wrote:
> Scott,
> 
> On Fri, Feb 22, 2013 at 07:59:41PM -0600, Scott Wood wrote:
> > We should also give a message if one of the CRCs is bad, though  
> that's
> > an existing problem.
> 
> Yes, that would be nice. While writing this, I also had the idea of
> introducing some macros for unified message output, like so:
> 
> | #define __print(level, ...) {
> |	printf("*** %s - ", level);
> |	printf(__VA_ARGS__);
> |	printf("\n");
> | }
> | #define perror(...) __print("Error", __VA_ARGS__)
> | #define pwarn(...) __print("Warning", __VA_ARGS__)
> | ...
> 
> What do you think? That would require diligently touching a lot of
> source files, of course.

This suggestion belongs in its own thread with an appropriate subject,  
but if we do anything like this we should use pr_warn(), pr_err(), etc.  
since we share a bunch of code with Linux -- although output from that  
code may be made worse since it's not expecting the prefixes...

-Scott


More information about the U-Boot mailing list