From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 25 Feb 2013 16:40:04 -0600 Subject: [U-Boot] [PATCHv2 3/4] env_nand.c: clarify log messages when env reading fails In-Reply-To: <20130225093912.GD17784@philter.vipri.net> (from phil.sutter@viprinet.com on Mon Feb 25 03:39:12 2013) References: <1353502761-12640-1-git-send-email-phil.sutter@viprinet.com> <1361467316-29044-1-git-send-email-phil.sutter@viprinet.com> <1361467316-29044-4-git-send-email-phil.sutter@viprinet.com> <20130223015941.GA10876@home.buserror.net> <20130225093912.GD17784@philter.vipri.net> Message-ID: <1361832004.27903.14@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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